remove unused comment

This commit is contained in:
wataru 2023-06-16 17:13:45 +09:00
parent d7f5828710
commit 4f427d5700
2 changed files with 1 additions and 3 deletions

View File

@ -1181,7 +1181,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useMessageBuilder: () => (/* binding */ useMessageBuilder)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar useMessageBuilder = function useMessageBuilder() {\n var messagesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);\n var setMessage = function setMessage(file, id, message) {\n if (messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) {\n console.warn(\"duplicate message is registerd\", file, id, message);\n } else {\n messagesRef.current.push({\n file: file,\n id: id,\n message: message\n });\n }\n };\n var getMessage = function getMessage(file, id) {\n var _messagesRef$current$;\n var lang = window.navigator.language;\n if (lang != \"ja\") {\n lang = \"en\";\n }\n console.log(messagesRef.current);\n return ((_messagesRef$current$ = messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) === null || _messagesRef$current$ === void 0 ? void 0 : _messagesRef$current$.message[lang]) || \"unknwon message\";\n };\n return {\n setMessage: setMessage,\n getMessage: getMessage\n };\n};\n\n//# sourceURL=webpack://demo/./src/hooks/useMessageBuilder.ts?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useMessageBuilder: () => (/* binding */ useMessageBuilder)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar useMessageBuilder = function useMessageBuilder() {\n var messagesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);\n var setMessage = function setMessage(file, id, message) {\n if (messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) {\n console.warn(\"duplicate message is registerd\", file, id, message);\n } else {\n messagesRef.current.push({\n file: file,\n id: id,\n message: message\n });\n }\n };\n var getMessage = function getMessage(file, id) {\n var _messagesRef$current$;\n var lang = window.navigator.language;\n if (lang != \"ja\") {\n lang = \"en\";\n }\n return ((_messagesRef$current$ = messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) === null || _messagesRef$current$ === void 0 ? void 0 : _messagesRef$current$.message[lang]) || \"unknwon message\";\n };\n return {\n setMessage: setMessage,\n getMessage: getMessage\n };\n};\n\n//# sourceURL=webpack://demo/./src/hooks/useMessageBuilder.ts?");
/***/ }),

View File

@ -26,8 +26,6 @@ export const useMessageBuilder = (): MessageBuilderStateAndMethod => {
if (lang != "ja") {
lang = "en"
}
console.log(messagesRef.current)
return messagesRef.current.find(x => { return x.file == file && x.id == id })?.message[lang] || "unknwon message"
}
return {