Skip to content

Commit c9e6e84

Browse files
Vinnlunknown
authored andcommitted
Make sure the store's UpdateManager is typed
1 parent 632f813 commit c9e6e84

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

scratchpad/data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export const initialise: InitialisationFunction = async (store, user) => {
1212
const [_setContentDeletions, setContentAdditions] = getSetContentsStatements('', creationDate, pad, store, user)
1313

1414
const statementsToAdd = initialisationAdditions.concat(setContentAdditions)
15-
await store.updater.put(pad, statementsToAdd, 'text/turtle', () => undefined)
15+
if (store.updater) {
16+
await store.updater.put(pad, statementsToAdd, 'text/turtle', () => undefined)
17+
}
1618
return pad
1719
}
1820

scratchpad/view.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export function view ({ container, subject, store, visitNode, user }: ViewParams
7777

7878
const creationDate = new Date()
7979
const [setContentDeletions, setContentAdditions] = getSetContentsStatements(textArea.value, creationDate, subject, store, user)
80-
store.updater.update(setContentDeletions, setContentAdditions, toViewMode)
80+
if (store.updater) {
81+
store.updater.update(setContentDeletions, setContentAdditions, toViewMode)
82+
}
8183
})
8284
}
8385
}

typings/rdflib/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,10 @@ export class IndexedFormula extends Formula {
740740
* The number of statements in this formula
741741
*/
742742
length: number;
743+
/**
744+
* An UpdateManager initialised to this store
745+
*/
746+
updater?: UpdateManager;
743747
/**
744748
* Creates a new formula
745749
* @param features The list of features to support

0 commit comments

Comments
 (0)