-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1769 from snypy/fixes-snippet-loading
Fixes snippet loading when switching scopes
- Loading branch information
Showing
5 changed files
with
19 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<div> | ||
<span routerLink="/dashboard" class="user" (click)="loadUser()"> | ||
<span routerLink="/user" class="user"> | ||
<fa-icon icon="user"></fa-icon> | ||
</span> | ||
<span routerLink="/dashboard" class="user visually" (click)="loadGlobal()"> | ||
<span routerLink="/global" class="user"> | ||
<fa-icon icon="globe"></fa-icon> | ||
</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,8 @@ | ||
import { Component } from '@angular/core'; | ||
import { Store } from '@ngxs/store'; | ||
import { ActiveFilterService } from '../../services/navigation/activeFilter.service'; | ||
import { AuthResource } from '../../services/resources/auth.resource'; | ||
import { UpdateScope } from '../../state/scope/scope.actions'; | ||
|
||
@Component({ | ||
selector: 'app-view-switch', | ||
templateUrl: './view-switch.component.html', | ||
styleUrls: ['./view-switch.component.scss'], | ||
}) | ||
export class ViewSwitchComponent { | ||
constructor(private store: Store, private authResource: AuthResource, private activeFilterService: ActiveFilterService) {} | ||
|
||
loadUser(): void { | ||
console.log('Loading user!'); | ||
this.activeFilterService.updateFilter('main', 'all', false); | ||
this.store.dispatch( | ||
new UpdateScope({ | ||
area: 'user', | ||
value: this.authResource.currentUser, | ||
}) | ||
); | ||
} | ||
|
||
loadGlobal(): void { | ||
console.log('Loading global!'); | ||
this.store.dispatch( | ||
new UpdateScope({ | ||
area: 'global', | ||
value: null, | ||
}) | ||
); | ||
} | ||
} | ||
export class ViewSwitchComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters