dexie-cloud-addon 4.0.0-beta.14 → 4.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modern/dexie-cloud-addon.js +8 -4
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +7 -3
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/module-es5/dexie-cloud-addon.js +8 -5
- package/dist/module-es5/dexie-cloud-addon.js.map +1 -1
- package/dist/module-es5/dexie-cloud-addon.min.js +1 -1
- package/dist/module-es5/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.js +8 -5
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +7 -3
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/dist/umd-modern/dexie-cloud-addon.js +5 -1
- package/dist/umd-modern/dexie-cloud-addon.js.map +1 -1
- package/package.json +1 -1
|
@@ -5733,6 +5733,7 @@
|
|
|
5733
5733
|
//
|
|
5734
5734
|
const currentUserEmitter = getCurrentUserEmitter(dexie);
|
|
5735
5735
|
const subscriptions = [];
|
|
5736
|
+
let configuredProgramatically = false;
|
|
5736
5737
|
// local sync worker - used when there's no service worker.
|
|
5737
5738
|
let localSyncWorker = null;
|
|
5738
5739
|
dexie.on('ready', async (dexie) => {
|
|
@@ -5782,6 +5783,7 @@
|
|
|
5782
5783
|
invites: getInvitesObservable(dexie),
|
|
5783
5784
|
configure(options) {
|
|
5784
5785
|
options = dexie.cloud.options = { ...dexie.cloud.options, ...options };
|
|
5786
|
+
configuredProgramatically = true;
|
|
5785
5787
|
if (options.databaseUrl && options.nameSuffix) {
|
|
5786
5788
|
// @ts-ignore
|
|
5787
5789
|
dexie.name = `${origIdbName}-${getDbNameFromDbUrl(options.databaseUrl)}`;
|
|
@@ -5868,7 +5870,7 @@
|
|
|
5868
5870
|
db.getSchema(),
|
|
5869
5871
|
db.getPersistedSyncState(),
|
|
5870
5872
|
]);
|
|
5871
|
-
if (!
|
|
5873
|
+
if (!configuredProgramatically) {
|
|
5872
5874
|
// Options not specified programatically (use case for SW!)
|
|
5873
5875
|
// Take persisted options:
|
|
5874
5876
|
db.cloud.options = persistedOptions || null;
|
|
@@ -5876,6 +5878,8 @@
|
|
|
5876
5878
|
else if (!persistedOptions ||
|
|
5877
5879
|
JSON.stringify(persistedOptions) !== JSON.stringify(options)) {
|
|
5878
5880
|
// Update persisted options:
|
|
5881
|
+
if (!options)
|
|
5882
|
+
throw new Error(`Internal error`); // options cannot be null if configuredProgramatically is set.
|
|
5879
5883
|
await db.$syncState.put(options, 'options');
|
|
5880
5884
|
}
|
|
5881
5885
|
if (db.cloud.options?.tryUseServiceWorker &&
|