Handle error messages

This commit is contained in:
gion 2020-04-22 22:48:26 +02:00
parent 71f72f836c
commit a2ba96ab82
3 changed files with 26 additions and 5 deletions

View File

@ -57,7 +57,7 @@ function showNewJoinGroupSelection (button, user, apiClient) {
icon: "group", icon: "group",
id: group.GroupId, id: group.GroupId,
selected: false, selected: false,
secondaryText: group.Partecipants.join(", ") secondaryText: group.Participants.join(", ")
}; };
}); });
@ -74,7 +74,7 @@ function showNewJoinGroupSelection (button, user, apiClient) {
if (menuItems.length === 0) { if (menuItems.length === 0) {
if (inSession && policy.SyncplayAccess === "JoinGroups") { if (inSession && policy.SyncplayAccess === "JoinGroups") {
toast({ toast({
text: globalize.translate('MessageSyncplayPermissionRequired') text: globalize.translate('MessageSyncplayCreateGroupDenied')
}); });
} else { } else {
toast({ toast({

View File

@ -274,7 +274,25 @@ class SyncplayManager {
text: globalize.translate('MessageSyncplayGroupWait', cmd.Data) text: globalize.translate('MessageSyncplayGroupWait', cmd.Data)
}); });
break; break;
case 'KeepAlive': case 'GroupNotJoined':
toast({
text: globalize.translate('MessageSyncplayGroupNotJoined', cmd.Data)
});
break;
case 'CreateGroupDenied':
toast({
text: globalize.translate('MessageSyncplayCreateGroupDenied', cmd.Data)
});
break;
case 'JoinGroupDenied':
toast({
text: globalize.translate('MessageSyncplayJoinGroupDenied', cmd.Data)
});
break;
case 'LibraryAccessDenied':
toast({
text: globalize.translate('MessageSyncplayLibraryAccessDenied', cmd.Data)
});
break; break;
default: default:
console.error('processSyncplayGroupUpdate does not recognize: ' + cmd.Type); console.error('processSyncplayGroupUpdate does not recognize: ' + cmd.Type);

View File

@ -1034,9 +1034,12 @@
"MessageSyncplayUserJoined": "<b>{0}</b> joined group.", "MessageSyncplayUserJoined": "<b>{0}</b> joined group.",
"MessageSyncplayUserLeft": "<b>{0}</b> left group.", "MessageSyncplayUserLeft": "<b>{0}</b> left group.",
"MessageSyncplayGroupWait": "<b>{0}</b> is buffering...", "MessageSyncplayGroupWait": "<b>{0}</b> is buffering...",
"MessageSyncplayNoGroupsAvailable": "No groups available.", "MessageSyncplayNoGroupsAvailable": "No groups available. Start playing something first.",
"MessageSyncplayPermissionRequired": "Permission required to create a group.",
"MessageSyncplayPlaybackPermissionRequired": "Playback permission required.", "MessageSyncplayPlaybackPermissionRequired": "Playback permission required.",
"MessageSyncplayGroupNotJoined": "Failed to join requested group.",
"MessageSyncplayCreateGroupDenied": "Permission required to create a group.",
"MessageSyncplayJoinGroupDenied": "Permission required to use Syncplay.",
"MessageSyncplayLibraryAccessDenied": "Access to this content is restricted.",
"Metadata": "Metadata", "Metadata": "Metadata",
"MetadataManager": "Metadata Manager", "MetadataManager": "Metadata Manager",
"MetadataSettingChangeHelp": "Changing metadata settings will affect new content that is added going forward. To refresh existing content, open the detail screen and click the refresh button, or perform bulk refreshes using the metadata manager.", "MetadataSettingChangeHelp": "Changing metadata settings will affect new content that is added going forward. To refresh existing content, open the detail screen and click the refresh button, or perform bulk refreshes using the metadata manager.",