Skip to content

Commit

Permalink
fix: dependency cycle
Browse files Browse the repository at this point in the history
Blurhashes are going to be cached soon, so it's simpler to just remove the watcher for now and call it a day

Signed-off-by: Fernando Fernández <[email protected]>
  • Loading branch information
ferferga committed Sep 6, 2024
1 parent 8984a2d commit 851b0c7
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions frontend/src/plugins/workers/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { wrap } from 'comlink';
import { watch } from 'vue';
import type { IBlurhashDecoder } from './blurhash-decoder.worker';
import BlurhashDecoder from './blurhash-decoder.worker?worker';
import type { ICanvasDrawer } from './canvas-drawer.worker';
import CanvasDrawer from './canvas-drawer.worker?worker';
import type { IGenericWorker } from './generic.worker';
import GenericWorker from './generic.worker?worker';
import { remote } from '@/plugins/remote';

/**
* A worker for decoding blurhash strings into pixels
Expand All @@ -33,15 +31,3 @@ export const canvasDrawer = wrap<ICanvasDrawer>(new CanvasDrawer());
* blocking the main thread
*/
export const genericWorker = wrap<IGenericWorker>(new GenericWorker());

/**
* Clear cached blurhashes on logout
*/
watch(
() => remote.auth.currentUser,
async () => {
if (remote.auth.currentUser === undefined) {
await blurhashDecoder.clearCache();
}
}, { flush: 'post' }
);

0 comments on commit 851b0c7

Please sign in to comment.