mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
use empty string if no cookie value found
redux doesn't like getting null values for actions, so give empty ones /cc @rschamp
This commit is contained in:
parent
300831c1e1
commit
5cc6eb3ecb
2 changed files with 4 additions and 0 deletions
|
@ -24,6 +24,8 @@ module.exports.getPermissions = function () {
|
|||
return function (dispatch) {
|
||||
jar.getUnsignedValue('scratchsessionsid', 'permissions', function (err, value) {
|
||||
if (err) return dispatch(module.exports.setPermissionsError(err));
|
||||
|
||||
value = value || {};
|
||||
return dispatch(module.exports.setPermissions(value));
|
||||
});
|
||||
};
|
||||
|
|
|
@ -27,6 +27,8 @@ module.exports.getToken = function () {
|
|||
return function (dispatch) {
|
||||
jar.getUnsignedValue('scratchsessionsid', 'token', function (err, value) {
|
||||
if (err) return dispatch(module.exports.setTokenError(err));
|
||||
|
||||
value = value || '';
|
||||
return dispatch(module.exports.setToken(value));
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue