expand usage of signals
This commit is contained in:
parent
68c38a1a47
commit
e57ea4b4c0
3 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { overlayStore } from "../../stores";
|
import { overlayStore } from "../../stores";
|
||||||
import { methods, remoteCall } from "../../request";
|
import { methods, remoteCall, remoteSignal } from "../../request";
|
||||||
import { maybeModalFade, maybeModalScale } from "../../animations";
|
import { maybeModalFade, maybeModalScale } from "../../animations";
|
||||||
|
|
||||||
let channelName = "";
|
let channelName = "";
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
const create = async () => {
|
const create = async () => {
|
||||||
createButtonEnabled = false;
|
createButtonEnabled = false;
|
||||||
const { ok } = await remoteCall(methods.createChannel, channelName);
|
const { ok } = await remoteSignal(methods.createChannel, channelName);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
overlayStore.toast("Couldn't create channel");
|
overlayStore.toast("Couldn't create channel");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { maybeModalFade, maybeModalScale } from "../../animations";
|
import { maybeModalFade, maybeModalScale } from "../../animations";
|
||||||
import { overlayStore } from "../../stores";
|
import { overlayStore } from "../../stores";
|
||||||
import { methods, remoteCall } from "../../request";
|
import { methods, remoteCall, remoteSignal } from "../../request";
|
||||||
|
|
||||||
export let channel;
|
export let channel;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
buttonsEnabled = false;
|
buttonsEnabled = false;
|
||||||
const { ok } = await remoteCall(methods.updateChannelName, channel.id, channelName);
|
const { ok } = await remoteSignal(methods.updateChannelName, channel.id, channelName);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
overlayStore.toast("Couldn't edit channel");
|
overlayStore.toast("Couldn't edit channel");
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
};
|
};
|
||||||
const deleteChannel = async () => {
|
const deleteChannel = async () => {
|
||||||
buttonsEnabled = false;
|
buttonsEnabled = false;
|
||||||
const { ok } = await remoteCall(methods.deleteChannel, channel.id);
|
const { ok } = await remoteSignal(methods.deleteChannel, channel.id);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
overlayStore.toast("Couldn't delete channel");
|
overlayStore.toast("Couldn't delete channel");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { overlayStore } from "../../stores";
|
import { overlayStore } from "../../stores";
|
||||||
import { methods, remoteCall } from "../../request";
|
import { methods, remoteCall, remoteSignal } from "../../request";
|
||||||
import { maybeModalFade, maybeModalScale } from "../../animations";
|
import { maybeModalFade, maybeModalScale } from "../../animations";
|
||||||
|
|
||||||
export let message;
|
export let message;
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
buttonsEnabled = false;
|
buttonsEnabled = false;
|
||||||
const { ok } = await remoteCall(methods.updateMessageContent, message.id, messageContent);
|
const { ok } = await remoteSignal(methods.updateMessageContent, message.id, messageContent);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
overlayStore.toast("Couldn't edit message");
|
overlayStore.toast("Couldn't edit message");
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
};
|
};
|
||||||
const deleteMessage = async () => {
|
const deleteMessage = async () => {
|
||||||
buttonsEnabled = false;
|
buttonsEnabled = false;
|
||||||
const { ok } = await remoteCall(methods.deleteMessage, message.id);
|
const { ok } = await remoteSignal(methods.deleteMessage, message.id);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
overlayStore.toast("Couldn't delete message");
|
overlayStore.toast("Couldn't delete message");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue