MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / start

Method start

renderer/renderJS/main_ui_lib.js:2082–2127  ·  view source on GitHub ↗
(mode, selectAll, selectOne)

Source from the content-addressed store, hash-verified

2080
2081 // MARK: start (button)
2082 start(mode, selectAll, selectOne) {
2083 if ( selectAll.length === 0 ) { return }
2084
2085 const realSelect = selectOne !== null ? new Set([selectOne]) : selectAll
2086
2087 this.flags.operation = mode
2088 this.flags.isRunning = true
2089
2090 this.selectedDest.clear()
2091 this.buttonDest.clear()
2092 this.lastPayload = null
2093
2094 switch (mode) {
2095 case 'favs' :
2096 window.main_IPC.files.listFavs().then((files) => {
2097 if ( files === null ) {
2098 MA.byId('moveButton_fav').classList.add('btn-shake')
2099 setTimeout(() => {
2100 MA.byId('moveButton_fav').classList.remove('btn-shake')
2101 }, 1500)
2102 } else {
2103 this.display(mode, files)
2104 }
2105 })
2106 break
2107 case 'copy' :
2108 case 'move' :
2109 case 'delete' :
2110 window.main_IPC.files.list(mode, [...realSelect]).then((files) => {
2111 this.display(mode, files)
2112 })
2113 break
2114 case 'zip' :
2115 window.main_IPC.files.exportZIP([...realSelect])
2116 this.stop()
2117 break
2118 case 'openMods' :
2119 return window.main_IPC.files.openExplore([...realSelect][0])
2120 case 'openHub' :
2121 return window.main_IPC.files.openModHub([...realSelect][0])
2122 case 'openExt' :
2123 return window.main_IPC.files.openExtSite([...realSelect][0])
2124 default :
2125 break
2126 }
2127 }
2128
2129 // MARK: user buttons
2130 selectDestination(single = true, dest) {

Callers 2

startFileMethod · 0.45
util_lib.jsFile · 0.45

Calls 5

displayMethod · 0.95
stopMethod · 0.95
clearMethod · 0.80
addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected