Skip to content

Commit 41a5326

Browse files
committed
added toast logs when importing/exporting presets
1 parent c0071ce commit 41a5326

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

ui/src/app/sections/effects/equalizers/advanced-equalizer/advanced-equalizer.component.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { EqualizerComponent } from '../equalizer.component'
1212
import { Options, CheckboxOption } from 'src/app/components/options/options.component'
1313
import { TransitionService } from '../../../../services/transitions.service'
1414
import { ApplicationService } from '../../../../services/app.service'
15+
import { ToastService } from '../../../../services/toast.service'
1516

1617
@Component({
1718
selector: 'eqm-advanced-equalizer',
@@ -32,11 +33,23 @@ export class AdvancedEqualizerComponent extends EqualizerComponent implements On
3233
{
3334
type: 'button',
3435
label: 'Import Presets',
35-
action: () => this.service.importPresets()
36+
action: async () => {
37+
const log = await this.service.importPresets()
38+
this.toast.show({
39+
type: 'success',
40+
message: log
41+
})
42+
}
3643
}, {
3744
type: 'button',
3845
label: 'Export Presets',
39-
action: () => this.service.exportPresets()
46+
action: async () => {
47+
const log = await this.service.exportPresets()
48+
this.toast.show({
49+
type: 'success',
50+
message: log
51+
})
52+
}
4053
}
4154
], [
4255
this.ShowDefaultPresetsCheckbox
@@ -105,7 +118,8 @@ export class AdvancedEqualizerComponent extends EqualizerComponent implements On
105118
public service: AdvancedEqualizerService,
106119
public transition: TransitionService,
107120
public change: ChangeDetectorRef,
108-
public app: ApplicationService
121+
public app: ApplicationService,
122+
public toast: ToastService
109123
) {
110124
super()
111125
this.getImportLegacyAvailable()
@@ -130,10 +144,14 @@ export class AdvancedEqualizerComponent extends EqualizerComponent implements On
130144
type: 'button',
131145
label: 'Import eqMac2 Presets',
132146
action: async () => {
133-
await this.service.importLegacy()
147+
const log = await this.service.importLegacyPresets()
134148
if (this.settingsDialog) {
135149
this.settingsDialog.close()
136150
}
151+
this.toast.show({
152+
type: 'success',
153+
message: log
154+
})
137155
}
138156
}
139157
)

ui/src/app/sections/effects/equalizers/advanced-equalizer/advanced-equalizer.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class AdvancedEqualizerService extends EqualizersService {
5959
})
6060
}
6161

62-
async importLegacy () {
62+
async importLegacyPresets () {
6363
return this.request({ method: 'GET', endpoint: '/presets/import-legacy' })
6464
}
6565

0 commit comments

Comments
 (0)