Skip to content

Commit

Permalink
[#132656977] pages hidden when no game selected
Browse files Browse the repository at this point in the history
this hides category and profile management when no game is currently selected. If I'm not mistaken these are the last pages that were visible incorrectly
  • Loading branch information
TanninOne committed Jan 24, 2017
1 parent ab8f03d commit dc44565
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/extensions/category_management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import CategoryList from './views/CategoryList';
function init(context: IExtensionContext): boolean {
context.registerMainPage('book', 'Categories', CategoryList, {
hotkey: 'C',
visible: () => context.api.store.getState().settings.gameMode.current,
});

context.registerReducer(['persistent', 'categories'], categoryReducer);
Expand Down
3 changes: 3 additions & 0 deletions src/extensions/hardlink_activator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class ModActivator extends LinkingActivator {
const activeGameId = state.settings.gameMode.current;
const activeGameDiscovery: IDiscoveryResult =
state.settings.gameMode.discovered[activeGameId];
if (activeGameDiscovery === undefined) {
return false;
}

try {
fsOrig.accessSync(activeGameDiscovery.modPath, fsOrig.constants.W_OK);
Expand Down
1 change: 1 addition & 0 deletions src/extensions/profile_management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface IExtensionContextExt extends IExtensionContext {
function init(context: IExtensionContextExt): boolean {
context.registerMainPage('clone', 'Profiles', ProfileView, {
hotkey: 'P',
visible: () => context.api.store.getState().settings.gameMode.current,
});

context.registerReducer(['gameSettings', 'profiles'], profilesReducer);
Expand Down

0 comments on commit dc44565

Please sign in to comment.