File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
components/notion/sources/updated-page Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import notion from "../../notion.app.mjs";
22import sampleEmit from "./test-event.mjs" ;
33import base from "../common/base.mjs" ;
44import constants from "../common/constants.mjs" ;
5+ import zlib from "zlib" ;
56
67export default {
78 ...base ,
@@ -69,10 +70,15 @@ export default {
6970 methods : {
7071 ...base . methods ,
7172 _getPropertyValues ( ) {
72- return this . db . get ( "propertyValues" ) ;
73+ const compressed = this . db . get ( "propertyValues" ) ;
74+ const buffer = Buffer . from ( compressed , "base64" ) ;
75+ const decompressed = zlib . inflateSync ( buffer ) . toString ( ) ;
76+ return JSON . parse ( decompressed ) ;
7377 } ,
7478 _setPropertyValues ( propertyValues ) {
75- this . db . set ( "propertyValues" , propertyValues ) ;
79+ const string = JSON . stringify ( propertyValues ) ;
80+ const compressed = zlib . deflateSync ( string ) . toString ( "base64" ) ;
81+ this . db . set ( "propertyValues" , compressed ) ;
7682 } ,
7783 async getPropertiesToCheck ( ) {
7884 if ( this . properties ?. length ) {
You can’t perform that action at this time.
0 commit comments