mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 18:37:04 -04:00
Fake Nitro Transform Stickers option and other stuff (#683)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
99391a4f0e
commit
12ffb9d642
4 changed files with 269 additions and 76 deletions
|
@ -43,6 +43,7 @@ const settings = definePluginSettings({
|
|||
|
||||
let crashCount: number = 0;
|
||||
let lastCrashTimestamp: number = 0;
|
||||
let shouldAttemptNextHandle = false;
|
||||
|
||||
export default definePlugin({
|
||||
name: "CrashHandler",
|
||||
|
@ -72,6 +73,10 @@ export default definePlugin({
|
|||
],
|
||||
|
||||
handleCrash(_this: ReactElement & { forceUpdate: () => void; }) {
|
||||
if (Date.now() - lastCrashTimestamp <= 1_000 && !shouldAttemptNextHandle) return true;
|
||||
|
||||
shouldAttemptNextHandle = false;
|
||||
|
||||
if (++crashCount > 5) {
|
||||
try {
|
||||
showNotification({
|
||||
|
@ -151,6 +156,7 @@ export default definePlugin({
|
|||
}
|
||||
|
||||
try {
|
||||
shouldAttemptNextHandle = true;
|
||||
_this.forceUpdate();
|
||||
} catch (err) {
|
||||
CrashHandlerLogger.debug("Failed to update crash handler component.", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue