From f133395db7d8141981552fa1d278b48dca274ebb Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Fri, 2 Jun 2023 21:01:25 +0000
Subject: [PATCH] Add timestamp changes

---
 wasm/collective.go | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/wasm/collective.go b/wasm/collective.go
index c6ee44fd..5c2eb771 100644
--- a/wasm/collective.go
+++ b/wasm/collective.go
@@ -517,12 +517,11 @@ func (rsCB *RemoteStore) Write(path string, data []byte) error {
 //   - JSON of [bindings.RemoteStoreReport] (Uint8Array).
 //   - Catches any thrown errors (of type Error) and returns it as an error.
 func (rsCB *RemoteStore) GetLastModified(path string) (string, error) {
-	fn := func() js.Value { return rsCB.getLastModified(path) }
-	v, err := exception.RunAndCatch(fn)
+	v, err := utils.Await(rsCB.getLastModified(path))
 	if err != nil {
-		return "", err
+		return "", js.Error{Value: err[0]}
 	}
-	return v.String(), err
+	return v[0].String(), nil
 }
 
 // GetLastWrite implements [bindings.RemoteStore.GetLastWrite()
@@ -531,12 +530,11 @@ func (rsCB *RemoteStore) GetLastModified(path string) (string, error) {
 //   - JSON of [bindings.RemoteStoreReport] (Uint8Array).
 //   - Catches any thrown errors (of type Error) and returns it as an error.
 func (rsCB *RemoteStore) GetLastWrite() (string, error) {
-	fn := func() js.Value { return rsCB.getLastWrite() }
-	v, err := exception.RunAndCatch(fn)
+	v, err := utils.Await(rsCB.getLastWrite())
 	if err != nil {
-		return "", err
+		return "", js.Error{Value: err[0]}
 	}
-	return v.String(), err
+	return v[0].String(), nil
 }
 
 // ReadDir implements [bindings.RemoteStore.ReadDir]
-- 
GitLab