feat: implement manual per-account refresh for instant ban and cooldown updates
This commit is contained in:
@@ -49,6 +49,7 @@ interface AccountsContextType {
|
||||
updateServerConfig: (config: Partial<ServerConfig>) => Promise<void>;
|
||||
loginToServer: () => Promise<void>;
|
||||
syncNow: () => Promise<void>;
|
||||
scrapeAccount: (steamId: string) => Promise<boolean>;
|
||||
getCommunityAccounts: () => Promise<any[]>;
|
||||
getServerUsers: () => Promise<any[]>;
|
||||
refreshAccounts: (showLoading?: boolean) => Promise<void>;
|
||||
@@ -114,6 +115,12 @@ export const AccountsProvider: React.FC<{ children: React.ReactNode }> = ({ chil
|
||||
}
|
||||
};
|
||||
|
||||
const scrapeAccount = async (steamId: string) => {
|
||||
const success = await (window as any).electronAPI.scrapeAccount(steamId);
|
||||
if (success) await syncNow();
|
||||
return success;
|
||||
};
|
||||
|
||||
const addAccount = async (data: { identifier: string }) => {
|
||||
await (window as any).electronAPI.addAccount(data);
|
||||
await refreshAccounts();
|
||||
@@ -194,7 +201,7 @@ export const AccountsProvider: React.FC<{ children: React.ReactNode }> = ({ chil
|
||||
accounts, serverConfig, isLoading, isSyncing, addAccount, updateAccount, deleteAccount,
|
||||
switchAccount, openSteamAppLogin, openSteamLogin, updateServerConfig, loginToServer,
|
||||
getCommunityAccounts, getServerUsers, shareAccountWithUser, revokeAccountAccess, revokeAllAccountAccess, syncNow, refreshAccounts,
|
||||
adminGetStats, adminGetUsers, adminDeleteUser, adminGetAccounts, adminRemoveAccount
|
||||
scrapeAccount, adminGetStats, adminGetUsers, adminDeleteUser, adminGetAccounts, adminRemoveAccount
|
||||
}}>
|
||||
{children}
|
||||
</AccountsContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user