-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor selection of proxy / Display default proxy in Options
- Loading branch information
Showing
4 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
import { ref } from 'vue'; | ||
|
||
const showLocations = ref(false); | ||
const hostProxySelect = ref(false); | ||
const customProxy = ref(''); | ||
const customProxySelect = ref(false); | ||
const customProxyHost = ref(''); | ||
|
||
const useLocations = () => { | ||
const toggleLocations = () => { | ||
showLocations.value = !showLocations.value; | ||
}; | ||
return { customProxy, hostProxySelect, showLocations, toggleLocations }; | ||
|
||
const proxySelect = (host?: string) => { | ||
// when host is not provided, it means the user is selecting a proxy for all websites | ||
customProxyHost.value = host ? host : ''; | ||
customProxySelect.value = !!host; | ||
toggleLocations(); | ||
}; | ||
|
||
return { customProxyHost, customProxySelect, proxySelect, showLocations, toggleLocations }; | ||
}; | ||
|
||
export default useLocations; |