mattermost-mobile/service/utils/preference_utils.js
Harrison Healey 1115d882ca PLT-5566 Added clientside handling to automatically show direct channels (#270)
* Added TestServerUrl config setting

* Added clientside handling to show direct channels in the sidebar when a DM is received
2017-02-17 10:53:46 -05:00

18 lines
545 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
export function getPreferenceKey(category, name) {
return `${category}--${name}`;
}
export function getPreferencesByCategory(myPreferences, category) {
const prefix = `${category}--`;
const preferences = new Map();
Object.keys(myPreferences).forEach((key) => {
if (key.startsWith(prefix)) {
preferences.set(key.substring(prefix.length), myPreferences[key]);
}
});
return preferences;
}