MCPcopy
hub / github.com/leaningtech/webvm / handleCopyIP

Function handleCopyIP

src/lib/network.js:90–107  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

88}
89
90async function handleCopyIP(event)
91{
92 // To prevent the default contexmenu from showing up when right-clicking..
93 event.preventDefault();
94 // Copy the IP to the clipboard.
95 try
96 {
97 await window.navigator.clipboard.writeText(networkData.currentIp)
98 connectionState.set("IPCOPIED");
99 setTimeout(() => {
100 connectionState.set("CONNECTED");
101 }, 2000);
102 }
103 catch(msg)
104 {
105 console.log("Copy ip to clipboard: Error: " + msg);
106 }
107}
108
109export function updateButtonData(state, handleConnect) {
110 switch(state) {

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected