Merge branch 'hotfix/21.56.9' into master
[gitter.git] / server / handlers / snapshots / right-toolbar-snapshot.js
blob007294a774da7f4530008693cbf744912bee7169
1 'use strict';
3 var userSettingsService = require('gitter-web-user-settings');
5 function getSnapshotsForPageContext(req) {
6 if (!req.user) return {};
7 return userSettingsService
8 .getUserSettings(req.user._id, 'rightToolbar')
9 .then(function(rightToolbarUserSettings) {
10 var isPinned;
12 if (!rightToolbarUserSettings || rightToolbarUserSettings.isPinned === undefined) {
13 // Default to pinned
14 isPinned = true;
15 } else {
16 isPinned = rightToolbarUserSettings.isPinned;
18 return {
19 isPinned: isPinned
21 });
24 module.exports = getSnapshotsForPageContext;