Skip to content

Commit

Permalink
rename API to Dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Jan 18, 2023
1 parent f73dcc2 commit c423d23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Deputy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DeputyCommunications from './DeputyCommunications';
import DeputySession from './session/DeputySession';
import DeputyCasePage from './wiki/DeputyCasePage';
import normalizeTitle from './wiki/util/normalizeTitle';
import DeputyAPI from './api/DeputyAPI';
import DeputyDispatch from './api/DeputyDispatch';
import sectionHeadingName from './wiki/util/sectionHeadingName';
import ContributionSurveyRow from './models/ContributionSurveyRow';
import getPageContent from './wiki/util/getPageContent';
Expand Down Expand Up @@ -42,7 +42,7 @@ class Deputy {
* @private
*/
static instance: Deputy;
readonly DeputyAPI = DeputyAPI;
readonly DeputyDispatch = DeputyDispatch;
readonly DeputyStorage = DeputyStorage;
readonly DeputySession = DeputySession;
readonly DeputyPreferences = DeputyPreferences;
Expand Down Expand Up @@ -81,7 +81,7 @@ class Deputy {

// Components

api: DeputyAPI;
dispatch: DeputyDispatch;
storage: DeputyStorage;
prefs: DeputyPreferences;
comms: DeputyCommunications;
Expand Down Expand Up @@ -158,7 +158,7 @@ class Deputy {
this.storage = new DeputyStorage();
await this.storage.init();
// Initialize the Deputy API interface
this.api = new DeputyAPI();
this.dispatch = new DeputyDispatch();
// Initialize the Deputy preferences instance
this.prefs = new DeputyPreferences();
// Initialize communications
Expand Down
2 changes: 1 addition & 1 deletion src/api/DeputyAPI.ts → src/api/DeputyDispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Requester from '../util/Requester';
/**
* API communication class
*/
export default class DeputyAPI {
export default class DeputyDispatch {

/**
* Token used for authentication on the server side. Allows access to deleted
Expand Down
8 changes: 5 additions & 3 deletions src/models/ContributionSurveyRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export default class ContributionSurveyRow {
}
}
if ( toCache.length > 0 ) {
const expandedData = await window.deputy.api.getExpandedRevisionData( toCache );
const expandedData = await window.deputy.dispatch.getExpandedRevisionData( toCache );
for ( const revisionID in expandedData ) {
revisionData.set(
+revisionID,
Expand Down Expand Up @@ -355,10 +355,11 @@ export default class ContributionSurveyRow {
*
* @return The comment with the status indicator removed.
*/
getActualComment() {
getActualComment(): string {
if ( this.originalStatus === ContributionSurveyRowStatus.Unfinished ) {
return '';
} else if ( this.statusIsolated === false ||
} else if (
this.statusIsolated === false ||
this.originalStatus === ContributionSurveyRowStatus.Unknown
) {
return this.comment;
Expand All @@ -377,6 +378,7 @@ export default class ContributionSurveyRow {
''
).trim();
}
return '';
}

}

0 comments on commit c423d23

Please sign in to comment.