All files / app/page/settings/local local.component.ts

59.09% Statements 13/22
53.33% Branches 8/15
45.45% Functions 5/11
47.05% Lines 8/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 631x                     1x     1x 1x   1x       4x       4x                                               4x                          
import { Component } from '@angular/core';
import { RouterLink } from '@angular/router';
import { ModService } from '../../../service/mod.service';
import { Store } from '../../../store/store';
 
@Component({
  selector: 'app-settings-local-page',
  templateUrl: './local.component.html',
  styleUrls: ['./local.component.scss'],
  imports: [RouterLink],
})
export class SettingsLocalPageI {
 
  constructor(
    private mod: ModService,
    public store: Store,
  ) {
    mod.setTitle($localize`Settings: Local Storage`);
  }
 
  get refEntries() {
    return this.store.local.getRefKeys();
  }
 
  get extEntries() {
    return this.store.local.getExtKeys();
  }
 
  clearRefEntry(key: string) {
    this.store.local.clearRefEntry(key);
  }
 
  clearAllRefs() {
    if (confirm($localize`Are you sure you want to clear all Ref entries from local storage?`)) {
      this.store.local.clearAllRefs();
    }
  }
 
  clearExtEntry(tag: string) {
    this.store.local.clearExtEntry(tag);
  }
 
  clearAllExts() {
    if (confirm($localize`Are you sure you want to clear all Ext entries from local storage?`)) {
      this.store.local.clearAllExts();
    }
  }
 
  get helpEntries() {
    return this.store.local.getHelpKeys();
  }
 
  clearHelpEntry(key: string) {
    this.store.local.clearHelpEntry(key);
  }
 
  clearAllHelp() {
    if (confirm($localize`Are you sure you want to clear all help message history from local storage?`)) {
      this.store.local.clearAllHelp();
    }
  }
}