Skip to content

Commit

Permalink
Merge pull request #25 from nAgI314/main
Browse files Browse the repository at this point in the history
Added: confirmation when deleting
  • Loading branch information
mint73 committed May 30, 2024
2 parents 8c238ea + 62d3ffe commit 8238cfc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function App() {
let sum = 0;

// 模擬店かどうか判別
if (code.indexOf("焼きそば") === 0) {
if (code.indexOf("チュロス") === 0) {
const allArray = code.split(";");// 品ごとに分割
var nameArray: string[] = new Array(allArray.length - 1);
var costArray: number[] = new Array(allArray.length - 1);
Expand Down Expand Up @@ -222,7 +222,7 @@ function App() {
const _code = e;

// 模擬店かどうか判別
if (_code.indexOf("焼きそば") === 0) {
if (_code.indexOf("チュロス") === 0) {
// 品ごとに分割
const _allArray = _code.replace(/\s+/g, "").split(";");
var _nameArray: string[] = new Array(_allArray.length - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/dataToFirebase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const PreserveDataComponent: React.FC<{ data: Obj[], data2: Obj[] }> = ({
const getPassword = async () => {
const querySnapshot = await getDocs(collection(db, "passwords"));
const fetchedData = querySnapshot.docs.map(doc => doc.data());
console.log(fetchedData);
//console.log(fetchedData);
//passwordArray
for (let i = 0; i < fetchedData.length; i++) {
passwordArray[i] = fetchedData[i].password;
Expand Down
10 changes: 6 additions & 4 deletions src/showCal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ const ItemTable: React.FC<{ items: Item[] }> = ({ items }) => {
};

const deleteData = () => {
setItemList(items.map(item => ({ ...item, quantity: 0 })));
setSum(0);
set_InputValue("");
setchange(0);
if(window.confirm("本当に削除しますか?")===true){
setItemList(items.map(item => ({ ...item, quantity: 0 })));
setSum(0);
set_InputValue("");
setchange(0);
}
}

// const returnChange = () => {
Expand Down

0 comments on commit 8238cfc

Please sign in to comment.