Skip to content

Commit

Permalink
fix: increment runTimes on preinit (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 authored Jan 27, 2023
1 parent a06434c commit 7970204
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/components/molecules/Visualizer/Plugin/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ import { exposed } from "./api";
import { useContext } from "./context";
import type { PluginModalInfo } from "./ModalContainer";
import type { PluginPopupInfo } from "./PopupContainer";
import type {
Layer,
Widget,
Block,
GlobalThis,
ReearthEventType,
WidgetLocationOptions,
} from "./types";
import type { Layer, Widget, Block, GlobalThis, ReearthEventType } from "./types";

export default function ({
pluginId,
Expand Down Expand Up @@ -256,6 +249,7 @@ export function useAPI({
const instanceId = widget?.id ?? block?.id;
if (instanceId) {
ctx?.pluginInstances.addPluginMessageSender(instanceId, pluginMessageSender);
ctx?.pluginInstances.runTimesCache.increment(instanceId);
}
}, [
ctx?.reearth.on,
Expand Down Expand Up @@ -396,10 +390,7 @@ export function useAPI({
},
startEventLoop,
overrideSceneProperty: ctx.overrideSceneProperty,
moveWidget: (widgetId: string, options: WidgetLocationOptions) => {
ctx.moveWidget?.(widgetId, options);
ctx.pluginInstances.runTimesCache.increment(widgetId);
},
moveWidget: ctx.moveWidget,
pluginPostMessage: ctx.pluginInstances.postMessage,
clientStorage: ctx.clientStorage,
});
Expand Down

0 comments on commit 7970204

Please sign in to comment.