You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-10 23:22:22 +02:00
feat(web): make google cast opt in (#18514)
* add setting switch this isnt bound to anything yet * make google casting opt-in * doc updates * lint docs * remove unneeded translation items * update mobile openai defs * fix failing test we need to mock user prefs since CastButton uses it
This commit is contained in:
@@ -85,6 +85,11 @@ class PurchaseUpdate {
|
||||
hideBuyButtonUntil?: string;
|
||||
}
|
||||
|
||||
class CastUpdate {
|
||||
@ValidateBoolean({ optional: true })
|
||||
gCastEnabled?: boolean;
|
||||
}
|
||||
|
||||
export class UserPreferencesUpdateDto {
|
||||
@Optional()
|
||||
@ValidateNested()
|
||||
@@ -135,6 +140,11 @@ export class UserPreferencesUpdateDto {
|
||||
@ValidateNested()
|
||||
@Type(() => PurchaseUpdate)
|
||||
purchase?: PurchaseUpdate;
|
||||
|
||||
@Optional()
|
||||
@ValidateNested()
|
||||
@Type(() => CastUpdate)
|
||||
cast?: CastUpdate;
|
||||
}
|
||||
|
||||
class RatingsResponse {
|
||||
@@ -183,6 +193,10 @@ class PurchaseResponse {
|
||||
hideBuyButtonUntil!: string;
|
||||
}
|
||||
|
||||
class CastResponse {
|
||||
gCastEnabled: boolean = false;
|
||||
}
|
||||
|
||||
export class UserPreferencesResponseDto implements UserPreferences {
|
||||
folders!: FoldersResponse;
|
||||
memories!: MemoriesResponse;
|
||||
@@ -193,6 +207,7 @@ export class UserPreferencesResponseDto implements UserPreferences {
|
||||
emailNotifications!: EmailNotificationsResponse;
|
||||
download!: DownloadResponse;
|
||||
purchase!: PurchaseResponse;
|
||||
cast!: CastResponse;
|
||||
}
|
||||
|
||||
export const mapPreferences = (preferences: UserPreferences): UserPreferencesResponseDto => {
|
||||
|
@@ -502,6 +502,9 @@ export interface UserPreferences {
|
||||
showSupportBadge: boolean;
|
||||
hideBuyButtonUntil: string;
|
||||
};
|
||||
cast: {
|
||||
gCastEnabled: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface UserMetadata extends Record<UserMetadataKey, Record<string, any>> {
|
||||
|
@@ -42,6 +42,9 @@ const getDefaultPreferences = (): UserPreferences => {
|
||||
showSupportBadge: true,
|
||||
hideBuyButtonUntil: new Date(2022, 1, 12).toISOString(),
|
||||
},
|
||||
cast: {
|
||||
gCastEnabled: false,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user