Skip to content

Commit

Permalink
yarn build
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwellll committed Sep 20, 2024
1 parent 3011475 commit ac227f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/hellotext.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions lib/models/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ var Cookies = /*#__PURE__*/function () {
_createClass(Cookies, null, [{
key: "set",
value: function set(name, value) {
document.cookie = "".concat(name, "=").concat(value);
if (typeof document !== 'undefined') {
document.cookie = "".concat(name, "=").concat(value);
}
_hellotext.default.eventEmitter.dispatch('session-set', value);
return value;
}
}, {
key: "get",
value: function get(name) {
var _document$cookie$matc;
return (_document$cookie$matc = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')) === null || _document$cookie$matc === void 0 ? void 0 : _document$cookie$matc.pop();
if (typeof document !== 'undefined') {
var _document$cookie$matc;
return (_document$cookie$matc = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')) === null || _document$cookie$matc === void 0 ? void 0 : _document$cookie$matc.pop();
} else {
return undefined;
}
}
}]);
return Cookies;
Expand Down

0 comments on commit ac227f8

Please sign in to comment.