Add check for database query
This commit is contained in:
parent
1414080db6
commit
88c165d5ab
@ -201,7 +201,9 @@ function ImportExportModal({
|
|||||||
let newTokens: Token[] = [];
|
let newTokens: Token[] = [];
|
||||||
if (checkedTokens.length > 0) {
|
if (checkedTokens.length > 0) {
|
||||||
const tokenIds = checkedTokens.map((token) => token.id);
|
const tokenIds = checkedTokens.map((token) => token.id);
|
||||||
const tokensToAdd: Token[] = await importDB.table<Token>("tokens").bulkGet(tokenIds);
|
const tokensToAdd: Token[] | undefined = await importDB.table<Token>("tokens").bulkGet(tokenIds);
|
||||||
|
|
||||||
|
if (tokensToAdd) {
|
||||||
for (let token of tokensToAdd) {
|
for (let token of tokensToAdd) {
|
||||||
if (token) {
|
if (token) {
|
||||||
// Generate new ids
|
// Generate new ids
|
||||||
@ -235,6 +237,7 @@ function ImportExportModal({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let newMaps: Map[] = [];
|
let newMaps: Map[] = [];
|
||||||
let newStates: MapState[] = [];
|
let newStates: MapState[] = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user