Skip to content

Commit

Permalink
Update NetworkingCard.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Jan 8, 2024
1 parent d9d5e83 commit b5dddac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion photon-client/src/components/settings/NetworkingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import { useStateStore } from "@/stores/StateStore";
// Copy object to remove reference to store
const tempSettingsStruct = ref<ConfigurableNetworkSettings>(Object.assign({}, useSettingsStore().network));
const resetTempSettingsStruct = () => {
tempSettingsStruct.value = Object.assign({}, useSettingsStore().network);
};
const settingsValid = ref(true);
const isValidNetworkTablesIP = (v: string | undefined): boolean => {
// Check if it is a valid team number between 1-9999
const teamNumberRegex = /^[1-9][0-9]{0,3}$/;
Expand Down Expand Up @@ -83,7 +88,10 @@ const saveGeneralSettings = () => {
});
// Update the local settings cause the backend checked their validity. Assign is to deref value
useSettingsStore().network = Object.assign({}, tempSettingsStruct.value);
useSettingsStore().network = {
...useSettingsStore().network,
...Object.assign({}, tempSettingsStruct.value)
};
})
.catch((error) => {
resetTempSettingsStruct();
Expand Down

0 comments on commit b5dddac

Please sign in to comment.