import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { AppSettingsService } from '.';
import { AppSettings } from '../models-legacy';

@Injectable({
    providedIn: 'root',
})
export class SettingsResolver implements Resolve<AppSettings> {
    static KEY = 'settings';
    constructor(private settings: AppSettingsService) {}
    resolve(): Promise<AppSettings> {
        return this.settings.getSettings();
    }
}
