-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed: Fixed an issue where the right click paste was empty string #1575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -601,18 +601,18 @@ export const initElEvent = ( | |
text = await readText(); | ||
} catch (e) { | ||
if (terminalStore.termSelectionText !== '') text = terminalStore.termSelectionText; | ||
} finally { | ||
socket.send( | ||
JSON.stringify({ | ||
id: kubernetesStore.globalTerminalId, | ||
k8s_id: terminalStore.currentTab, | ||
type: 'TERMINAL_K8S_DATA', | ||
data: text | ||
}) | ||
); | ||
} | ||
|
||
e.preventDefault(); | ||
|
||
socket.send( | ||
JSON.stringify({ | ||
id: kubernetesStore.globalTerminalId, | ||
k8s_id: terminalStore.currentTab, | ||
type: 'TERMINAL_K8S_DATA', | ||
data: text | ||
}) | ||
); | ||
}, | ||
false | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code does not seem to contain any significant irregularities, potential issues, or optimizations at present. It appears well-written and ready for use. Here is an update that could help improve readability: export const initElEvent = async (text, textToRead) => { ...
}
const readTextFromLocal = () =>
new Promise((resolve) => {
// implementation goes here
}); This way, both lines should be easier to understand, especially Let me know if you need further assistance, and please let me know if you have more questions about this or anything else related to programming. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There doesn't seem to be any issues with these lines of code. All the declared modules follow the recommended naming conventions, which should avoid conflicts in the project's external packages.
However, you may want to consider a few things:
@@
,declare
, etc) are placed at the top of your file instead of right before the other files' declaration.Main
and similar to something more unique if they appear frequently.In general,
will likely look cleaner than importing the same thing twice.
Also, make sure you have imported necessary libraries (e.g.,
numpy
) first if needed.If there’s anything specific that needs optimization or explanation about the code style or functionality, please provide further details so I can offer helpful insights!