This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
// Metro module 1220 (f1221).
import Module589 from "../_bundle/Module589";
import Dispatcher from "../Dispatcher";
import Module38 from "../_bundle/Module38";
import { Storage } from "../_bundle/Module595";
class MobileCacheSnapshotStore extends Module589.Store {
static allStores = [];
constructor(a0, a1) {
const r10 = {
...a0,
CLEAR_CACHES: () => {
this.clear();
return false;
},
WRITE_CACHES: () => {
this.save();
return false;
}
};
super(Dispatcher, r10, a1);
Module38(this.getClass().displayName != null, "Snapshot stores need a display name");
Module38(!("CLEAR_CACHES" in a0), "MobileCacheSnapshotStores cannot use the 'CLEAR_CACHES' action");
Module38(!("WRITE_CACHES" in a0), "MobileCacheSnapshotStores cannot use the 'WRITE_CACHES' action");
MobileCacheSnapshotStore.allStores.push(this);
}
static clearAll() {
MobileCacheSnapshotStore.allStores.forEach((allStore) => allStore.clear());
}
get persistKey() {
return `${this.getClass().displayName}-snapshot`;
}
clear() {
Storage.remove(this.persistKey);
}
save() {
Storage.set(this.persistKey, this.takeSnapshot());
}
readSnapshot(a0) {
const r12 = Storage.get(this.persistKey);
return r12 == null ? null : r12.version === a0 ? r12.data : null;
}
getClass() {
return this.constructor;
}
}
export default MobileCacheSnapshotStore;