const unsubProgress = await listen<ProgressState>(
'export_logs_progress',
action(({ payload }) => {
this.chunks += payload.progress;
this.state = payload.state;
})
);
const unsubFinished = await listen<SaveLogsResult>(
'export_logs_finished',
({ payload }) => {
unsubFinished();
unsubProgress();
match(payload)
.with({ _result: 'success' }, (matched) => {
this.state = 'export_logs_finished';
defer.rs(matched);
})
.with({ _result: 'failure' }, (matched) => {
defer.rj(matched);
})
.exhaustive();
}
);
const unsubProgress = await listen<ProgressState>(
'export_logs_progress',
action(({ payload }) => {
this.chunks += payload.progress;
this.state = payload.state;
})
);
const unsubFinished = await listen<SaveLogsResult>(
'export_logs_finished',
({ payload }) => {
unsubFinished();
unsubProgress();
match(payload)
.with({ _result: 'success' }, (matched) => {
this.state = 'export_logs_finished';
defer.rs(matched);
})
.with({ _result: 'failure' }, (matched) => {
defer.rj(matched);
})
.exhaustive();
}
);