Skip to content

Commit

Permalink
Merge pull request #1525 from shadow-dot-cat/castaway/revert_alias_li…
Browse files Browse the repository at this point in the history
…mits

fix(aliases): Remove "limits" change, should be in another branch
  • Loading branch information
castaway authored Jan 17, 2024
2 parents a0da2bc + 2034b2a commit cc61c1a
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions src/app/rmm/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,29 @@ export class Alias {
) {
}
load(): Observable<any> {
this.app.ua.http.get('/rest/v1/aliases/limits').subscribe(
res => {
this.aliases_counter = {
total: res['result'].total,
current: res['result'].current,
};
},
error => {
return this.app.show_error('Could not load alias limits', 'Dismiss');
}
);

const req = this.app.ua.http.get('/rest/v1/aliases', {}).pipe(timeout(60000), share());
req.subscribe(
reply => {
if ( reply['status'] === 'error' ) {
this.app.show_error( reply['error'].join( '' ), 'Dismiss' );
return;
}
this.aliases = reply['result'].aliases;
const _unique = {};
for ( const value of this.aliases ) {
_unique[ value.localpart + '@' + value.domain ] = 1;
}
this.aliases_unique = Object.keys(_unique);
return;
},
error => {
return this.app.show_error('Could not load aliases.', 'Dismiss');
data => {
const reply = data;
if ( reply['status'] === 'error' ) {
this.app.show_error( reply['error'].join( '' ), 'Dismiss' );
return;
}
this.aliases = reply['result'].aliases;
const _unique = {};
for ( const value of this.aliases ) {
_unique[ value.localpart + '@' + value.domain ] = 1;
}
this.aliases_unique = Object.keys(_unique);
this.aliases_counter = {
total: reply['result'].counter.total,
current: reply['result'].counter.current,
};
return;
},
error => {
return this.app.show_error('Could not load aliases.', 'Dismiss');
}
);
return req;
}
Expand Down

0 comments on commit cc61c1a

Please sign in to comment.