Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
run: |
VERSION=$(git describe --tags --abbrev=0)

TAG_MESSAGE=$(git tag -l --format='%(contents)' "$VERSION")
TAG_MESSAGE=$(git tag -l --format='%(contents)' "$VERSION" | sed '/-----BEGIN PGP SIGNATURE-----/,$d')

if [ -n "$TAG_MESSAGE" ]; then
TAG_VERSION=$(echo "$TAG_MESSAGE" | head -1 | sed 's/Release //' | sed 's/^[[:space:]]*//')
Expand Down
9 changes: 6 additions & 3 deletions src/app/Services/Hostelworld/Api/AvailabilityClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AvailabilityClient {

await Promise.all(daysAfterToCheck.map(async days => {
const fromWithDaysAdded: Date = dateAddDays(from, days)
const toWithFromPlus3Days: Date = dateAddDays(fromWithDaysAdded, 2)
const toWithFromPlus3Days: Date = dateAddDays(fromWithDaysAdded, 3)

await delay(randomNumber(0, 3) * 100)

Expand Down Expand Up @@ -112,9 +112,12 @@ export class AvailabilityClient {
availability: HostelworldPropertyAvailability
): void {
for (const dorm of availability.rooms.dorms) {
const capacity: number = Number(dorm.capacity)
if (!capacity) continue

dorm.totalBedsAvailable = Math.ceil(
dorm.totalBedsAvailable / Number(dorm.capacity)
) * Number(dorm.capacity)
dorm.totalBedsAvailable / capacity
) * capacity
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class PropertyCardComponentPatcher {
Object.defineProperty(component.__vue__, 'stayingAvatars', {
configurable: true,
get: () => staying,
set: () => emptyFunction
set: emptyFunction
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class SearchPropertyListComponentPatcher {
Object.defineProperty(component, 'propertiesPerPage', {
configurable: true,
get: () => maxPossiblePropertiesFromRequest,
set: () => emptyFunction
set: emptyFunction
})
}

Expand All @@ -40,7 +40,7 @@ export class SearchPropertyListComponentPatcher {
Object.defineProperty(component, 'displayFeaturedProperties', {
configurable: true,
get: () => displayFeaturedProperties,
set: () => emptyFunction
set: emptyFunction
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/Utils/HttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class HttpClient {
const hasNotExpired: boolean = await this.storage.hasNotExpired(cacheKey)
if (hasNotExpired) return

const content: string = await response.text()
const content: string = await response.clone().text()
const cacheTimeInMs: number = (cacheInMinutes ?? this.defaultCacheTimeInMinutes) * 60 * 1000

return this.storage.put(cacheKey, content, cacheTimeInMs)
Expand Down
10 changes: 8 additions & 2 deletions src/app/Utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ export function shallowEqual (object1: Record<string, unknown>, object2: Record<
if (object1Keys.length !== object2Keys.length) return false

for (const key of object1Keys) {
if (object2Keys.includes(key) && object1[key] === object2[key]) continue
if (!object2Keys.includes(key)) return false

return false
const value1: unknown = object1[key]
const value2: unknown = object2[key]

if (value1 instanceof RegExp && value2 instanceof RegExp &&
value1.source === value2.source && value1.flags === value2.flags) continue

if (value1 !== value2) return false
}

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CustomXMLHttpRequest extends XMLHttpRequest {
return super.onloadend
}

set onloadend (callback: (event: ProgressEvent) => void | null) {
set onloadend (callback: ((event: ProgressEvent) => void) | null) {
super.onloadend = event => {
CustomXMLHttpRequest.interceptCallback?.(this, 'loadend')
callback?.(event)
Expand Down