Fix up hide/show toggle state, WITH broadcast hacK
This commit is contained in:
@@ -63,8 +63,10 @@ export async function write<K extends keyof Schema>(
|
||||
[key]: value,
|
||||
})
|
||||
writeToStorage(_state)
|
||||
broadcast.postMessage({event: {type: UPDATE_EVENT, key}})
|
||||
broadcast.postMessage({event: UPDATE_EVENT}) // Backcompat while upgrading
|
||||
setTimeout(() => {
|
||||
broadcast.postMessage({event: {type: UPDATE_EVENT, key}})
|
||||
broadcast.postMessage({event: UPDATE_EVENT}) // Backcompat while upgrading
|
||||
}, 0)
|
||||
}
|
||||
write satisfies PersistedApi['write']
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ const schema = z.object({
|
||||
subtitlesEnabled: z.boolean().optional(),
|
||||
/** @deprecated */
|
||||
mutedThreads: z.array(z.string()),
|
||||
hideSidebarTrendingTopics: z.boolean().optional(),
|
||||
trendingSidebarHidden: z.boolean().optional(),
|
||||
})
|
||||
export type Schema = z.infer<typeof schema>
|
||||
|
||||
@@ -171,6 +171,7 @@ export const defaults: Schema = {
|
||||
kawaii: false,
|
||||
hasCheckedForStarterPack: false,
|
||||
subtitlesEnabled: true,
|
||||
trendingSidebarHidden: false,
|
||||
}
|
||||
|
||||
export function tryParse(rawData: string): Schema | undefined {
|
||||
|
||||
Reference in New Issue
Block a user