mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Send Sync Notifications (#799)
* enabled send and added send sync notifications * updated jslib
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 6ac6df75d7...68bd93e45b
@@ -153,11 +153,11 @@ const routes: Routes = [
|
|||||||
canActivate: [UnauthGuardService],
|
canActivate: [UnauthGuardService],
|
||||||
data: { titleId: 'deleteAccount' },
|
data: { titleId: 'deleteAccount' },
|
||||||
},
|
},
|
||||||
/*{
|
{
|
||||||
path: 'send/:sendId/:key',
|
path: 'send/:sendId/:key',
|
||||||
component: AccessComponent,
|
component: AccessComponent,
|
||||||
data: { title: 'Bitwarden Send' },
|
data: { title: 'Bitwarden Send' },
|
||||||
},*/
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/vault">{{'myVault' | i18n}}</a>
|
<a class="nav-link" routerLink="/vault">{{'myVault' | i18n}}</a>
|
||||||
</li>
|
</li>
|
||||||
<!--<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/sends">Send</a>
|
<a class="nav-link" routerLink="/sends">Send</a>
|
||||||
</li>-->
|
</li>
|
||||||
<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/tools">{{'tools' | i18n}}</a>
|
<a class="nav-link" routerLink="/tools">{{'tools' | i18n}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
ComponentFactoryResolver,
|
ComponentFactoryResolver,
|
||||||
|
NgZone,
|
||||||
OnInit,
|
OnInit,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
@@ -20,6 +21,10 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
|
|||||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { SendService } from 'jslib/abstractions/send.service';
|
import { SendService } from 'jslib/abstractions/send.service';
|
||||||
|
|
||||||
|
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||||
|
|
||||||
|
const BroadcasterSubscriptionId = 'SendComponent';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-send',
|
selector: 'app-send',
|
||||||
templateUrl: 'send.component.html',
|
templateUrl: 'send.component.html',
|
||||||
@@ -49,11 +54,29 @@ export class SendComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private apiService: ApiService, private sendService: SendService,
|
constructor(private apiService: ApiService, private sendService: SendService,
|
||||||
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private platformUtilsService: PlatformUtilsService, private environmentService: EnvironmentService) { }
|
private platformUtilsService: PlatformUtilsService, private environmentService: EnvironmentService,
|
||||||
|
private broadcasterService: BroadcasterService, private ngZone: NgZone) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {
|
||||||
|
this.ngZone.run(async () => {
|
||||||
|
switch (message.command) {
|
||||||
|
case 'syncCompleted':
|
||||||
|
if (message.successfully) {
|
||||||
await this.load();
|
await this.load();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
await this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||||
|
}
|
||||||
|
|
||||||
async load(filter: (send: SendView) => boolean = null) {
|
async load(filter: (send: SendView) => boolean = null) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const sends = await this.sendService.getAllDecrypted();
|
const sends = await this.sendService.getAllDecrypted();
|
||||||
|
|||||||
Reference in New Issue
Block a user