Skip to content

Commit

Permalink
Merge pull request #558 from privacy-tech-lab/allow-no-address
Browse files Browse the repository at this point in the history
Allow no address
  • Loading branch information
JoeChampeau authored Jan 19, 2024
2 parents cafebfd + 3eb203f commit e371b3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/background/analysis/classModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const keywordTypes = Object.freeze({
placeholder: {
streetAddress: "45 Wyllys Ave",
city: "Middletown",
region: "Conneticut",
region: "Connecticut",
zipCode: "06459",
},
toolTip:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const validate = ({
badInput("city");
return false;
}
if (!inputValidator.city_address.test(address)) {
if (!inputValidator.city_address.test(address) && (address.length != 0)) {
badInput("address");
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const EditModal = ({ passKeywordType, passKeyword, edit, id, updateList }
);
const [keyword, setKeyword] = useState(edit ? passKeyword : "");
const [address, setAddress] = useState(
edit ? keyword[typeEnum.streetAddress] ?? null : ""
edit ? keyword[typeEnum.streetAddress] ?? "" : ""
);
const [city, setCity] = useState(edit ? keyword[typeEnum.city] ?? null : "");
const [region, setRegionloc] = useState(
Expand Down Expand Up @@ -203,11 +203,11 @@ export const EditModal = ({ passKeywordType, passKeyword, edit, id, updateList }
let key;
if (keywordType == permissionEnum.location) {
key = {
[typeEnum.streetAddress]: address,
[typeEnum.streetAddress]: (address == "" ? null : address),
[typeEnum.zipCode]: zip,
[typeEnum.region]: region,
[typeEnum.city]: city,
display: `${address}, ${city}, ${region} ${zip}`,
display: (address != "") ? `${address}, ${city}, ${region} ${zip}` : ` ${city}, ${region} ${zip}`,
};
} else {
key = keyword;
Expand Down

0 comments on commit e371b3f

Please sign in to comment.