diff --git a/main.go b/main.go index 9bf2a059bab4555283629321ebf398fd387da399..60aa541cc9e704bb78c06e8657291796f781bdc7 100644 --- a/main.go +++ b/main.go @@ -136,8 +136,8 @@ func setGlobals() { js.FuncOf(wasm.GetNotificationReportsForMe)) js.Global().Set("GetNoMessageErr", js.FuncOf(wasm.GetNoMessageErr)) js.Global().Set("CheckNoMessageErr", js.FuncOf(wasm.CheckNoMessageErr)) - js.Global().Set("NewChannelsDatabaseCipher", - js.FuncOf(wasm.NewChannelsDatabaseCipher)) + js.Global().Set("NewDatabaseCipher", + js.FuncOf(wasm.NewDatabaseCipher)) js.Global().Set("GetNotificationReportsForMe", js.FuncOf(wasm.GetNotificationReportsForMe)) diff --git a/wasm/channels.go b/wasm/channels.go index 558337832633cd7cd66b156c8d56f2fc467740e9..b1e27a2129abb4f4c7cf01931396ac0e6bfa280d 100644 --- a/wasm/channels.go +++ b/wasm/channels.go @@ -370,7 +370,7 @@ func LoadChannelsManager(_ js.Value, args []js.Value) any { // various events. The entire interface can be nil, but if defined, each // method must be implemented. // - args[6] - ID of [DbCipher] object in tracker (int). Create this -// object with [NewChannelsDatabaseCipher] and get its id with +// object with [NewDatabaseCipher] and get its id with // [DbCipher.GetID]. // // Returns a promise: @@ -488,7 +488,7 @@ func newChannelsManagerWithIndexedDb(cmixID int, wasmJsPath string, // various events. The entire interface can be nil, but if defined, each // method must be implemented. // - args[6] - ID of [DbCipher] object in tracker (int). Create this -// object with [NewChannelsDatabaseCipher] and get its id with +// object with [NewDatabaseCipher] and get its id with // [DbCipher.GetID]. // // Returns a promise: @@ -2340,7 +2340,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any { return DbCipherMap } -// NewChannelsDatabaseCipher constructs a [DbCipher] object. +// NewDatabaseCipher constructs a [DbCipher] object. // // Parameters: // - args[0] - The tracked [Cmix] object ID (int). @@ -2353,7 +2353,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any { // Returns: // - JavaScript representation of the [DbCipher] object. // - Throws an error if creating the cipher fails. -func NewChannelsDatabaseCipher(_ js.Value, args []js.Value) any { +func NewDatabaseCipher(_ js.Value, args []js.Value) any { cmixId := args[0].Int() password := utils.CopyBytesToGo(args[1]) plaintTextBlockSize := args[2].Int() @@ -2382,7 +2382,7 @@ func (c *DbCipher) GetID(js.Value, []js.Value) any { // // Parameters: // - args[0] - The data to be encrypted (Uint8Array). This must be smaller -// than the block size passed into [NewChannelsDatabaseCipher]. If it is +// than the block size passed into [NewDatabaseCipher]. If it is // larger, this will return an error. // // Returns: diff --git a/wasm_test.go b/wasm_test.go index b415ece5623aa4e235511fb1f9cb24058e02e384..1e0494dbe4f6e08ec9276aa3b984b5c245cfa7e8 100644 --- a/wasm_test.go +++ b/wasm_test.go @@ -42,7 +42,7 @@ func TestPublicFunctions(t *testing.T) { "NewEventModel": {}, "NewChannelsManagerGoEventModel": {}, "LoadChannelsManagerGoEventModel": {}, - "GetChannelDbCipherTrackerFromID": {}, + "GetDbCipherTrackerFromID": {}, // Version functions were renamed to differentiate between WASM and // client versions