mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feat/refactor matchmaker promise format (#293)
This commit is contained in:
28 files changed
+2144
-3159
No files matched your search
@@ -5,7 +5,6 @@ import { ContactsApp } from '../../../apps/contacts/components/ContactsApp';
|
||||
import { CalculatorApp } from '../../../apps/calculator/components/CalculatorApp';
|
||||
import { SettingsApp } from '../../../apps/settings/components/SettingsApp';
|
||||
import { MessagesApp } from '../../../apps/messages/components/MessagesApp';
|
||||
import { MatchApp } from '../../../apps/match/components/MatchApp';
|
||||
import { TwitterApp } from '../../../apps/twitter/components/TwitterApp';
|
||||
import { ExampleApp } from '../../../apps/example/components/ExampleApp';
|
||||
import { MarketplaceApp } from '../../../apps/marketplace/components/MarketplaceApp';
|
||||
@@ -35,6 +34,7 @@ import { MATCH_APP_PRIMARY_COLOR, MATCH_APP_TEXT_COLOR } from '../../../apps/mat
|
||||
import { SvgIconProps } from '@material-ui/core';
|
||||
import { INotificationIcon } from '../../notifications/providers/NotificationsProvider';
|
||||
import { BrowserApp } from '../../../apps/browser/components/BrowserApp';
|
||||
import { MatchApp } from '../../../apps/match/components/MatchApp';
|
||||
|
||||
export interface IAppConfig {
|
||||
id: string;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { phoneState } from './state';
|
||||
import { isEnvBrowser } from '../../../utils/misc';
|
||||
|
||||
export const useConfig = (): void => {
|
||||
const setResourceConfig = useSetRecoilState(phoneState.resourceConfig);
|
||||
if (!isEnvBrowser()) {
|
||||
const resourceName = (window as any)?.GetParentResourceName() || 'npwd';
|
||||
fetch(`https://cfx-nui-${resourceName}/config.json`).then(async (res) => {
|
||||
const config = await res.json();
|
||||
setResourceConfig(config);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user