mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
5d00294ee5
17 changed files with 62 additions and 77 deletions
|
@ -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 { EquicordDevsById, VencordDevsById } 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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue