Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
FixConnecting enmity port
Browse files Browse the repository at this point in the history
  • Loading branch information
aeongdesu committed Dec 12, 2023
1 parent 79d4a77 commit 2b23b1d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/FixConnecting/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "FixConnecting",
"description": "Fix the annoying Connecting bug (enmity port)",
"authors": [
{
"name": "sapphire",
"id": "757982547861962752"
}
],
"main": "src/index.ts",
"vendetta": {
"icon": "badconnection"
}
}
23 changes: 23 additions & 0 deletions plugins/FixConnecting/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// https://github.com/m4fn3/FixConnecting/blob/master/src/index.tsx

import { findByProps, findByStoreName } from "@vendetta/metro"
import { FluxDispatcher } from "@vendetta/metro/common"
import { after } from "@vendetta/patcher"
import { getAssetIDByName } from "@vendetta/ui/assets"
import { showToast } from "@vendetta/ui/toasts"

const startSession = findByProps("startSession")
const AuthenticationStore = findByStoreName("AuthenticationStore")

const unpatch = after("startSession", startSession, () => {
unpatch()
setTimeout(() => {
let session_id = AuthenticationStore.getSessionId()
if (!session_id) {
FluxDispatcher?.dispatch({type: "APP_STATE_UPDATE", state: "active"})
showToast("Automatically fixed Connecting bug!", getAssetIDByName("Check"))
}
}, 300)
})

export const onUnload = () => unpatch()

0 comments on commit 2b23b1d

Please sign in to comment.