@indietabletop/appkit 5.4.0 → 5.5.0
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/lib/store/index.tsx +14 -1
- package/package.json +1 -1
package/lib/store/index.tsx
CHANGED
|
@@ -67,7 +67,16 @@ export function createAppMachineProvider<
|
|
|
67
67
|
>(options: {
|
|
68
68
|
database: ModernIDB<Schema, Indexes> & DatabaseAppMachineMethods;
|
|
69
69
|
client: IndieTabletopClient;
|
|
70
|
-
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Which games should the machine pull game data for?
|
|
73
|
+
*
|
|
74
|
+
* If null is provided, no data will be pulled.
|
|
75
|
+
*
|
|
76
|
+
* @remarks Honestly this is a bit hacky and we should have a better way to
|
|
77
|
+
* disable sync entirely for apps that don't need it (e.g. the Creators App).
|
|
78
|
+
*/
|
|
79
|
+
pullGameDataFor: GameCode | GameCode[] | null;
|
|
71
80
|
}) {
|
|
72
81
|
const { client, database } = options;
|
|
73
82
|
|
|
@@ -123,6 +132,10 @@ export function createAppMachineProvider<
|
|
|
123
132
|
|
|
124
133
|
const pullChanges = fromPromise<PullResult, PullChangesInput>(
|
|
125
134
|
async ({ input }) => {
|
|
135
|
+
if (!options.pullGameDataFor) {
|
|
136
|
+
return new Success({ pulled: [] });
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
const result = await client.pullUserData({
|
|
127
140
|
include: options.pullGameDataFor,
|
|
128
141
|
sinceTs: input.sinceTs,
|