import { Component, linkEvent } from "inferno";
-import {
- GetSiteResponse,
- UserOperation,
- wsJsonToRes,
- wsUserOp,
-} from "lemmy-js-client";
import {
CreateCustomEmoji,
CustomEmojiResponse,
DeleteCustomEmoji,
DeleteCustomEmojiResponse,
EditCustomEmoji,
-} from "lemmy-js-client/dist/interfaces/api/custom_emoji";
+ GetSiteResponse,
+ UserOperation,
+ wsJsonToRes,
+ wsUserOp,
+} from "lemmy-js-client";
import { Subscription } from "rxjs";
import { i18n } from "../../i18next";
import { WebSocketService } from "../../services";
<tbody>
{this.state.customEmojis
.slice(
- (this.state.page - 1) * this.itemsPerPage,
- (this.state.page - 1) * this.itemsPerPage + this.itemsPerPage
+ Number((this.state.page - 1) * this.itemsPerPage),
+ Number(
+ (this.state.page - 1) * this.itemsPerPage +
+ this.itemsPerPage
+ )
)
.map((cv, index) => (
<tr key={index} ref={e => (this.scrollRef[cv.shortcode] = e)}>
category: event.target.value,
changed: true,
};
- custom_emojis[pagedIndex] = item;
+ custom_emojis[Number(pagedIndex)] = item;
props.form.setState({ customEmojis: custom_emojis });
}
shortcode: event.target.value,
changed: true,
};
- custom_emojis[pagedIndex] = item;
+ custom_emojis[Number(pagedIndex)] = item;
props.form.setState({ customEmojis: custom_emojis });
}
image_url: props.overrideValue ?? event.target.value,
changed: true,
};
- custom_emojis[pagedIndex] = item;
+ custom_emojis[Number(pagedIndex)] = item;
props.form.setState({ customEmojis: custom_emojis });
}
alt_text: event.target.value,
changed: true,
};
- custom_emojis[pagedIndex] = item;
+ custom_emojis[Number(pagedIndex)] = item;
props.form.setState({ customEmojis: custom_emojis });
}
keywords: event.target.value,
changed: true,
};
- custom_emojis[pagedIndex] = item;
+ custom_emojis[Number(pagedIndex)] = item;
props.form.setState({ customEmojis: custom_emojis });
}
WebSocketService.Instance.send(wsClient.deleteCustomEmoji(deleteForm));
} else {
let custom_emojis = [...props.form.state.customEmojis];
- custom_emojis.splice(pagedIndex, 1);
+ custom_emojis.splice(Number(pagedIndex), 1);
props.form.setState({ customEmojis: custom_emojis });
}
}
console.log("pictrs upload:");
console.log(res);
if (res.msg === "ok") {
- pictrsDeleteToast(
- `${i18n.t("click_to_delete_picture")}: ${file.name}`,
- `${i18n.t("picture_deleted")}: ${file.name}`,
- `${i18n.t("failed_to_delete_picture")}: ${file.name}`,
- res.delete_url as string
- );
+ pictrsDeleteToast(file.name, res.delete_url as string);
} else {
toast(JSON.stringify(res), "danger");
let hash = res.files?.at(0)?.file;