aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/data/common.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-31 01:16:10 +0800
committerGitHub <noreply@github.com>2020-07-31 01:16:10 +0800
commit3d014eee30cf91c2e2c19af5c5140db137ccf225 (patch)
tree89f1a7c16afaa66e5e0a4cc53b1b426209fbb0e6 /Timeline/ClientApp/src/app/data/common.ts
parente26b101fdec6cacb54d09e66c0ef06cfad5e490c (diff)
parentd48ca755bae9f24378eda3c0a25285ec4b97a761 (diff)
downloadtimeline-3d014eee30cf91c2e2c19af5c5140db137ccf225.tar.gz
timeline-3d014eee30cf91c2e2c19af5c5140db137ccf225.tar.bz2
timeline-3d014eee30cf91c2e2c19af5c5140db137ccf225.zip
Merge pull request #127 from crupest/offline-post
Add feature of offline post cache.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/common.ts')
-rw-r--r--Timeline/ClientApp/src/app/data/common.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/data/common.ts b/Timeline/ClientApp/src/app/data/common.ts
index 7f3f4e93..9f985ce6 100644
--- a/Timeline/ClientApp/src/app/data/common.ts
+++ b/Timeline/ClientApp/src/app/data/common.ts
@@ -1,4 +1,18 @@
+import localforage from 'localforage';
+
+export const dataStorage = localforage.createInstance({
+ name: 'data',
+ description: 'Database for offline data.',
+ driver: localforage.INDEXEDDB,
+});
+
export interface BlobWithUrl {
blob: Blob;
url: string;
}
+
+export class ForbiddenError extends Error {
+ constructor(message?: string) {
+ super(message);
+ }
+}