From 66ad549188321068f424c4156fe86a535629ddae Mon Sep 17 00:00:00 2001 From: Dalrae1 <52721173+Dalrae1@users.noreply.github.com> Date: Fri, 16 Sep 2022 23:52:38 -0700 Subject: [PATCH] Fix options for data sent to UI This will allow screenshot_basic:requestScreenshot to actually work correctly. The original code would not receive the options, and would cause the server export "requestClientScreenshot" to not send any requests back to the server when fileName is nil. Since the readme states that an undefined fileName should return a data uri this is the incorrect behavior --- src/client/client.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/client.ts b/src/client/client.ts index 7a9c2e4..e3e2354 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -73,8 +73,16 @@ onNet('screenshot_basic:requestScreenshot', (options: any, url: string) => { options.resultURL = null; options.correlation = registerCorrelation(() => {}); + + const realOptions = { + encoding: options.encoding, + targetURL: options.targetURL, + targetField: options.targetField, + resultURL: options.resultURL, + correlation: options.correlation, + }; SendNuiMessage(JSON.stringify({ - request: options + request: realOptions })); -}); \ No newline at end of file +});