summaryrefslogtreecommitdiff
path: root/frontend/src/steamfixes/reload.ts
blob: a986cc17ffbe63fa95e195c6ae9202a0a1539ab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { getFocusNavController, sleep } from '@decky/ui';

import Logger from '../logger';

const logger = new Logger('ReloadSteamFix');

declare global {
  var GamepadNavTree: any;
}

export default async function reloadFix() {
  // Hack to unbreak the ui when reloading it
  await sleep(4000);
  if (getFocusNavController()?.m_rgAllContexts?.length == 0) {
    SteamClient.URL.ExecuteSteamURL('steam://open/settings');
    logger.log('Applied UI reload fix.');
  }

  // This steamfix does not need to deinit.
  return () => {};
}