expand usage of signals

This commit is contained in:
hippoz 2023-02-22 02:57:05 +02:00
parent 68c38a1a47
commit e57ea4b4c0
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED
3 changed files with 8 additions and 8 deletions

View file

@ -1,6 +1,6 @@
<script>
import { overlayStore } from "../../stores";
import { methods, remoteCall } from "../../request";
import { methods, remoteCall, remoteSignal } from "../../request";
import { maybeModalFade, maybeModalScale } from "../../animations";
let channelName = "";
@ -9,7 +9,7 @@
const create = async () => {
createButtonEnabled = false;
const { ok } = await remoteCall(methods.createChannel, channelName);
const { ok } = await remoteSignal(methods.createChannel, channelName);
if (!ok) {
overlayStore.toast("Couldn't create channel");
}

View file

@ -1,7 +1,7 @@
<script>
import { maybeModalFade, maybeModalScale } from "../../animations";
import { overlayStore } from "../../stores";
import { methods, remoteCall } from "../../request";
import { methods, remoteCall, remoteSignal } from "../../request";
export let channel;
@ -11,7 +11,7 @@
const save = async () => {
buttonsEnabled = false;
const { ok } = await remoteCall(methods.updateChannelName, channel.id, channelName);
const { ok } = await remoteSignal(methods.updateChannelName, channel.id, channelName);
if (!ok) {
overlayStore.toast("Couldn't edit channel");
}
@ -19,7 +19,7 @@
};
const deleteChannel = async () => {
buttonsEnabled = false;
const { ok } = await remoteCall(methods.deleteChannel, channel.id);
const { ok } = await remoteSignal(methods.deleteChannel, channel.id);
if (!ok) {
overlayStore.toast("Couldn't delete channel");
}

View file

@ -1,6 +1,6 @@
<script>
import { overlayStore } from "../../stores";
import { methods, remoteCall } from "../../request";
import { methods, remoteCall, remoteSignal } from "../../request";
import { maybeModalFade, maybeModalScale } from "../../animations";
export let message;
@ -11,7 +11,7 @@
const save = async () => {
buttonsEnabled = false;
const { ok } = await remoteCall(methods.updateMessageContent, message.id, messageContent);
const { ok } = await remoteSignal(methods.updateMessageContent, message.id, messageContent);
if (!ok) {
overlayStore.toast("Couldn't edit message");
}
@ -19,7 +19,7 @@
};
const deleteMessage = async () => {
buttonsEnabled = false;
const { ok } = await remoteCall(methods.deleteMessage, message.id);
const { ok } = await remoteSignal(methods.deleteMessage, message.id);
if (!ok) {
overlayStore.toast("Couldn't delete message");
}