Skip to content

Commit

Permalink
[#15] added fallback Blob check for earlier node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Aug 28, 2022
1 parent 0aa9a3b commit dcf0be8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/pocketbase.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.es.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.es.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.6.1",
"version": "0.6.2",
"name": "pocketbase",
"description": "PocketBase JavaScript SDK",
"author": "Gani Georgiev",
Expand Down
5 changes: 4 additions & 1 deletion src/stores/BaseAuthStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ export default abstract class BaseAuthStore {

let result = cookieSerialize(key, JSON.stringify(rawData), options);

const resultLength = typeof Blob !== 'undefined' ?
(new Blob([result])).size : result.length;

// strip down the model data to the bare minimum
if (rawData.model && new Blob([result]).size > 4096) {
if (rawData.model && resultLength > 4096) {
rawData.model = {id: rawData?.model?.id, email: rawData?.model?.email};
if (this.model instanceof User) {
rawData.model.verified = this.model.verified;
Expand Down

0 comments on commit dcf0be8

Please sign in to comment.