|
|
@@ -26,7 +26,18 @@ export class RelationsService {
|
|
|
}
|
|
|
|
|
|
async syncSupportedGrowiCommands(relation:Relation): Promise<Relation> {
|
|
|
- const res = await this.getSupportedGrowiCommands(relation);
|
|
|
+ // assure forward compatibility GROWI version <= 4.3.0
|
|
|
+ let res;
|
|
|
+ try {
|
|
|
+ res = await this.getSupportedGrowiCommands(relation);
|
|
|
+ }
|
|
|
+ catch (err) {
|
|
|
+ if (err.response && err.response.status === 403) {
|
|
|
+ // this code runs if GROWI version <= 4.3.0
|
|
|
+ return relation;
|
|
|
+ }
|
|
|
+ throw err;
|
|
|
+ }
|
|
|
const { supportedCommandsForBroadcastUse, supportedCommandsForSingleUse } = res.data;
|
|
|
relation.supportedCommandsForBroadcastUse = supportedCommandsForBroadcastUse;
|
|
|
relation.supportedCommandsForSingleUse = supportedCommandsForSingleUse;
|