soiz1's picture
Upload 2891 files
6bcb42f verified
raw
history blame
947 Bytes
export default async function ({ addon, console }) {
addon.tab.redux.initialize();
addon.tab.redux.addEventListener("statechanged", ({ detail }) => {
if (addon.self.disabled) return;
if (
detail.action.type === "scratch-paint/clipboard/SET" ||
detail.action.type === "scratch-paint/clipboard/INCREMENT_PASTE_OFFSET"
) {
addon.tab.redux.dispatch({ type: "scratch-paint/clipboard/CLEAR_PASTE_OFFSET" });
}
});
addon.self.addEventListener("disabled", () => {
addon.tab.redux.dispatch({ type: "scratch-paint/clipboard/CLEAR_PASTE_OFFSET" });
addon.tab.redux.dispatch({ type: "scratch-paint/clipboard/INCREMENT_PASTE_OFFSET" });
});
addon.self.addEventListener("reenabled", () => {
addon.tab.redux.dispatch({ type: "scratch-paint/clipboard/CLEAR_PASTE_OFFSET" });
});
if (addon.self.enabledLate) {
addon.tab.redux.dispatch({ type: "scratch-paint/clipboard/CLEAR_PASTE_OFFSET" });
}
}