Fix clipboard api, IrcColors, and Memberlist Decorators (#3383)

Co-authored-by: Vending Machine <vendicated@riseup.net>
This commit is contained in:
sadan4 2025-04-16 14:34:16 -04:00 committed by GitHub
parent 82f9cd1d3a
commit 524202e49d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 58 additions and 66 deletions

View file

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Clipboard, Toasts } from "@webpack/common";
import { Toasts } from "@webpack/common";
import { copyToClipboard } from "./clipboard";
import { DevsById } from "./constants";
/**
@ -35,12 +36,8 @@ export function sleep(ms: number): Promise<void> {
return new Promise(r => setTimeout(r, ms));
}
export function copyWithToast(text: string, toastMessage = "Copied to clipboard!") {
if (Clipboard.SUPPORTS_COPY) {
Clipboard.copy(text);
} else {
toastMessage = "Your browser does not support copying to clipboard";
}
export async function copyWithToast(text: string, toastMessage = "Copied to clipboard!") {
await copyToClipboard(text);
Toasts.show({
message: toastMessage,
id: Toasts.genId(),