Changed direct channels in the sidebar to be displayed based on user preferences
Этот коммит содержится в:
@@ -637,3 +637,32 @@ export function getMyTeam() {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getDirectChannels() {
|
||||
if (isCallInProgress('getDirectChannels')) {
|
||||
return;
|
||||
}
|
||||
|
||||
callTracker.getDirectChannels = utils.getTimestamp();
|
||||
client.getPreferencesByName(
|
||||
'direct_channels',
|
||||
'show_hide',
|
||||
(data, textStatus, xhr) => {
|
||||
callTracker.getDirectChannels = 0;
|
||||
|
||||
if (xhr.status === 304 || !data) {
|
||||
return;
|
||||
}
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_PREFERENCES,
|
||||
preferences: data
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
callTracker.getDirectChannels = 0;
|
||||
dispatchError(err, 'getDirectChannels');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1141,3 +1141,17 @@ export function listIncomingHooks(success, error) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function getPreferencesByName(category, name, success, error) {
|
||||
$.ajax({
|
||||
url: `/api/v1/preferences/${category}/${name}`,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
success,
|
||||
error: (xhr, status, err) => {
|
||||
var e = handleError('getPreferencesByName', xhr, status, err);
|
||||
error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ module.exports = {
|
||||
RECIEVED_AUDITS: null,
|
||||
RECIEVED_TEAMS: null,
|
||||
RECIEVED_STATUSES: null,
|
||||
RECIEVED_PREFERENCES: null,
|
||||
|
||||
RECIEVED_MSG: null,
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user