Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Tormak9970/TabMaster into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Jun 27, 2024
2 parents 7d837ca + 25bbf21 commit db1a544
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/components/QuickAccessContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const QuickAccessContent: VFC<{}> = ({ }) => {

return (
<div className="tab-master-scope">
{LogController.errorFlag && <div style={{ padding: '0 15px', marginBottom: '40px' }}>
{LogController.errorFlag && <Focusable style={{ padding: '0 15px', marginBottom: '40px' }} onActivate={() => {}}>
<h3>
<FaCircleExclamation style={{ height: '.8em', marginRight: '5px' }} fill="red" />
Tab Master encountered an error
Expand All @@ -80,7 +80,7 @@ export const QuickAccessContent: VFC<{}> = ({ }) => {
<br />
for support.
</div>
</div>}
</Focusable>}
{hasSdTabs && !isMicroSDeckInstalled && !microSDeckNoticeHidden && (
<div className='notice-field-cont' style={{ paddingBottom: '10px' }}>
<Field>
Expand Down
37 changes: 18 additions & 19 deletions src/state/TabMasterManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ export class TabMasterManager {
asyncLoadOther() {
PythonInterop.getTags().then((res: TagResponse[] | Error) => {
if (res instanceof Error) {
LogController.log("TabMaster couldn't load tags settings");
LogController.error(res.message);
LogController.raiseError(`Error loading tags \n ${res.message}`)
} else {
if (this.allStoreTags.length === 0) {
this.allStoreTags = res;
Expand All @@ -523,8 +522,7 @@ export class TabMasterManager {
});
PythonInterop.getFriends().then((res: FriendEntry[] | Error) => {
if (res instanceof Error) {
LogController.log("TabMaster couldn't load friends settings");
LogController.error(res.message);
LogController.raiseError(`Error loading friends \n ${res.message}`)
} else {
if (this.currentUsersFriends.length === 0) {
this.currentUsersFriends = res;
Expand All @@ -533,8 +531,7 @@ export class TabMasterManager {
});
PythonInterop.getFriendsGames().then((res: Map<number, number[]> | Error) => {
if (res instanceof Error) {
LogController.log("TabMaster couldn't load friends games settings");
LogController.error(res.message);
LogController.raiseError(`Error loading friends games \n ${res.message}`)
} else {
if (this.friendsGameMap.size === 0) {
this.friendsGameMap = res;
Expand All @@ -552,20 +549,22 @@ export class TabMasterManager {
const profiles = await PythonInterop.getTabProfiles();

this.asyncLoadOther();

if (settings instanceof Error) {
LogController.log("TabMaster couldn't load tab settings");
LogController.error(settings.message);
return;
}
if (profiles instanceof Error) {
LogController.log("TabMaster couldn't load tab profiles");
LogController.error(profiles.message);
return;
try {
if (settings instanceof Error) {
throw new Error(`Error loading tab settings \n ${settings.message}`)
}
if (profiles instanceof Error) {
throw new Error(`Error loading tab profiles \n ${profiles.message}`)
}

this.tabProfileManager = new TabProfileManager(profiles);
TabErrorController.validateSettingsOnLoad((Object.keys(settings).length > 0) ? settings : defaultTabsSettings, this, this.finishLoadingTabs.bind(this));

} catch(e) {
if(e instanceof Error) {
LogController.raiseError(`Encountered an error while loading \n ${e.message}`)
}
}

this.tabProfileManager = new TabProfileManager(profiles);
TabErrorController.validateSettingsOnLoad((Object.keys(settings).length > 0) ? settings : defaultTabsSettings, this, this.finishLoadingTabs.bind(this));
};

/**
Expand Down

0 comments on commit db1a544

Please sign in to comment.