Use async/await in more places

This commit is contained in:
James Lyne 2021-05-18 18:23:10 +01:00
parent a6ae811660
commit a3aa04c2dd
5 changed files with 112 additions and 112 deletions

View File

@ -73,8 +73,9 @@ export default defineComponent({
}
},
handlePendingUpdates = () => {
useStore().dispatch(ActionTypes.POP_TILE_UPDATES, 10).then(updates => {
handlePendingUpdates = async () => {
const updates = await useStore().dispatch(ActionTypes.POP_TILE_UPDATES, 10);
for(const update of updates) {
layer.updateNamedTile(update.name, update.timestamp);
}
@ -85,7 +86,6 @@ export default defineComponent({
} else {
updateFrame = 0;
}
});
};
watch(active, (newValue) => newValue ? enableLayer() : disableLayer());

View File

@ -71,11 +71,12 @@ export default defineComponent({
layers.delete(id);
},
handlePendingUpdates = () => {
useStore().dispatch(ActionTypes.POP_AREA_UPDATES, {
handlePendingUpdates = async () => {
const updates = await useStore().dispatch(ActionTypes.POP_AREA_UPDATES, {
markerSet: props.set.id,
amount: 10,
}).then(updates => {
});
const converter = getPointConverter();
for(const update of updates) {
@ -98,7 +99,6 @@ export default defineComponent({
} else {
updateFrame = 0;
}
});
};
//FIXME: Prevent unnecessary repositioning when changing worlds

View File

@ -71,11 +71,12 @@ export default defineComponent({
layers.delete(id);
},
handlePendingUpdates = () => {
useStore().dispatch(ActionTypes.POP_CIRCLE_UPDATES, {
handlePendingUpdates = async () => {
const updates = await useStore().dispatch(ActionTypes.POP_CIRCLE_UPDATES, {
markerSet: props.set.id,
amount: 10,
}).then(updates => {
});
const converter = getPointConverter();
for(const update of updates) {
@ -98,7 +99,6 @@ export default defineComponent({
} else {
updateFrame = 0;
}
});
};
//FIXME: Prevent unnecessary repositioning when changing worlds

View File

@ -70,11 +70,12 @@ export default defineComponent({
layers.delete(id);
},
handlePendingUpdates = () => {
useStore().dispatch(ActionTypes.POP_LINE_UPDATES, {
handlePendingUpdates = async () => {
const updates = await useStore().dispatch(ActionTypes.POP_LINE_UPDATES, {
markerSet: props.set.id,
amount: 10,
}).then(updates => {
});
const converter = getPointConverter();
for(const update of updates) {
@ -97,7 +98,6 @@ export default defineComponent({
} else {
updateFrame = 0;
}
});
};
//FIXME: Prevent unnecessary repositioning when changing worlds

View File

@ -69,11 +69,12 @@ export default defineComponent({
layers.delete(id);
},
handlePendingUpdates = () => {
useStore().dispatch(ActionTypes.POP_MARKER_UPDATES, {
handlePendingUpdates = async () => {
const updates = await useStore().dispatch(ActionTypes.POP_MARKER_UPDATES, {
markerSet: props.set.id,
amount: 10,
}).then(updates => {
});
const projection = currentProjection.value;
for(const update of updates) {
@ -96,7 +97,6 @@ export default defineComponent({
} else {
updateFrame = 0;
}
});
};
//FIXME: Prevent unnecessary repositioning when changing worlds