Skip to content

Commit

Permalink
Merge pull request #118 from FltSv/92-value-check
Browse files Browse the repository at this point in the history
#92, #52, #99 Web関連の修正
  • Loading branch information
himarori authored Aug 16, 2024
2 parents 92784ba + a2690d7 commit 79def9c
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"type": "chrome",
"request": "launch",
"name": "debug",
"name": "web debug",
"preLaunchTask": "npm: start",
"url": "http://localhost:5000",
"webRoot": "${workspaceFolder}/Hosting",
Expand Down
223 changes: 20 additions & 203 deletions Hosting/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Hosting/src/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@ export async function signupWithEmail(email: string, pass: string) {
export async function signOut() {
await getAuth().signOut();
}

/**
* メールアドレス確認メールを再送信する
*/
export async function sendVerifyEmail() {
const user = getAuth().currentUser;
if (user) {
await sendEmailVerification(user);
}
}
33 changes: 17 additions & 16 deletions Hosting/src/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,28 +270,29 @@ export async function addGallery(data: Gallery) {
/** 住所から緯度経度を取得する */
async function getLatLngFromAddress(address: string) {
const geocoder = new google.maps.Geocoder();
const response = await geocoder.geocode(
{ address: address },
(results, status) => {
if (status !== google.maps.GeocoderStatus.OK) {
console.error('Geocoding API returned status:', status);
throw new Error(status);
}

if (results === null) {
throw new Error('result is null');
}

return;
},
const geocodingTask = new Promise<google.maps.GeocoderResult[]>(
(resolve, reject) =>
void geocoder.geocode({ address: address }, (results, status) => {
if (status !== google.maps.GeocoderStatus.OK) {
reject(new Error(status));
}

if (results !== null) {
resolve(results);
}

reject(new Error('result is null'));
}),
);

const results = await geocodingTask;

console.debug(
`get geocode: "${address}": `,
response.results[0].geometry.location.toJSON(),
results[0].geometry.location.toJSON(),
);

return response.results[0].geometry.location.toJSON();
return results[0].geometry.location.toJSON();
}

/** 日付の期間の表示値を返す */
Expand Down
Loading

0 comments on commit 79def9c

Please sign in to comment.