mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 01:11:07 +03:00
chore: refactor svelte reactivity (#24072)
This commit is contained in:
@@ -19,21 +19,23 @@ export type OcrBoundingBox = {
|
||||
class OcrManager {
|
||||
#data = $state<OcrBoundingBox[]>([]);
|
||||
showOverlay = $state(false);
|
||||
hasOcrData = $state(false);
|
||||
#hasOcrData = $derived(this.#data.length > 0);
|
||||
|
||||
get data() {
|
||||
return this.#data;
|
||||
}
|
||||
|
||||
get hasOcrData() {
|
||||
return this.#hasOcrData;
|
||||
}
|
||||
|
||||
async getAssetOcr(id: string) {
|
||||
this.#data = await getAssetOcr({ id });
|
||||
this.hasOcrData = this.#data.length > 0;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.#data = [];
|
||||
this.showOverlay = false;
|
||||
this.hasOcrData = false;
|
||||
}
|
||||
|
||||
toggleOcrBoundingBox() {
|
||||
|
||||
Reference in New Issue
Block a user