Skip to content

Commit 003ab94

Browse files
committed
format
1 parent b7f9104 commit 003ab94

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

plugins/installButton/index.jsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ const {
88
stores: { SelectedChannelStore },
99
},
1010
plugins,
11-
ui: { showToast, ToastColors, Button, ButtonColors, ButtonSizes, openModal, ModalRoot, ModalHeader, ModalBody, ModalFooter, ModalSizes },
11+
ui: {
12+
showToast,
13+
ToastColors,
14+
Button,
15+
ButtonColors,
16+
ButtonSizes,
17+
openModal,
18+
ModalRoot,
19+
ModalHeader,
20+
ModalBody,
21+
ModalFooter,
22+
ModalSizes,
23+
},
1224
solid: { createSignal },
1325
} = shelter;
1426

@@ -121,7 +133,11 @@ function Card(props) {
121133
}
122134

123135
function handleDispatch(payload) {
124-
if ((payload.type === "MESSAGE_CREATE" || payload.type === "MESSAGE_UPDATE") && payload.message.channel_id !== SelectedChannelStore.getChannelId()) return;
136+
if (
137+
(payload.type === "MESSAGE_CREATE" || payload.type === "MESSAGE_UPDATE") &&
138+
payload.message.channel_id !== SelectedChannelStore.getChannelId()
139+
)
140+
return;
125141

126142
const unobs = observeDom("[class*=messageContent] [class*=anchor]:not([data-instbtn])", async (element) => {
127143
// don't find element we've already replaced
@@ -206,7 +222,8 @@ function InstallationModal(props) {
206222
<WarningIcon />
207223
</div>
208224
<p class={classes.warningText}>
209-
Only install plugins from sources you trust. Plugins execute code and could access your private Discord data.
225+
Only install plugins from sources you trust. Plugins execute code and could access your private
226+
Discord data.
210227
</p>
211228
</div>
212229
</div>
@@ -276,7 +293,9 @@ async function handleInstall(url) {
276293
const TRIGGERS = ["MESSAGE_CREATE", "MESSAGE_UPDATE", "UPDATE_CHANNEL_DIMENSIONS"];
277294

278295
export function onLoad() {
279-
fetch("https://shindex.uwu.network/data").then((body) => body.json().then((repos) => repos.forEach((repo) => allowedUrls.push(repo.url))));
296+
fetch("https://shindex.uwu.network/data").then((body) =>
297+
body.json().then((repos) => repos.forEach((repo) => allowedUrls.push(repo.url))),
298+
);
280299

281300
for (const t of TRIGGERS) subscribe(t, handleDispatch);
282301

0 commit comments

Comments
 (0)