Commit ce9b4f1b authored by Muhammadali's avatar Muhammadali

update-

parent d5605256
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "2.9.3", "version": "2.9.4",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -59,11 +59,11 @@ const CallHistoryInputDropdown = ({ ...@@ -59,11 +59,11 @@ const CallHistoryInputDropdown = ({
{call_history.reverse().map((value, index) => ( {call_history.reverse().map((value, index) => (
<ModalDropDown.Item <ModalDropDown.Item
key={index} key={index}
onClick={() => selectFuncInset(value)} onClick={() => selectFuncInset(value.value)}
hoverBool={ hoverBool={
call_history.length - numberSelectHistory === index call_history.length - numberSelectHistory === index
}> }>
{value} {value.value}
</ModalDropDown.Item> </ModalDropDown.Item>
))} ))}
</ModalDropDown.Inset> </ModalDropDown.Inset>
......
...@@ -29,7 +29,13 @@ const ModalPhoneNumpad = ({ ...@@ -29,7 +29,13 @@ const ModalPhoneNumpad = ({
let currentCalls = localStorage.getItem('callhistory') let currentCalls = localStorage.getItem('callhistory')
? JSON.parse(localStorage.getItem('callhistory')) ? JSON.parse(localStorage.getItem('callhistory'))
: false; : false;
if (currentCalls) setCall_history(currentCalls); if (currentCalls) {
// currentCalls.forEach((element) => {
// element.value ? true : false;
// });
setCall_history(currentCalls);
}
}, [localStorage.getItem('callhistory'), inputValue]); }, [localStorage.getItem('callhistory'), inputValue]);
useEffect(() => { useEffect(() => {
...@@ -170,18 +176,24 @@ const ModalPhoneNumpad = ({ ...@@ -170,18 +176,24 @@ const ModalPhoneNumpad = ({
document.removeEventListener('keyup', handleKeyUp); document.removeEventListener('keyup', handleKeyUp);
}; };
}, [handleKeyUp]); }, [handleKeyUp]);
// `${Data.getHours()}:${Data.getMinutes()} ${Data.getDate()}.${Data.getMonth()+1}.${Data.getFullYear()}`
const callButton = () => { const callButton = () => {
// inset if ---------- // inset if ----------
// ------------------- // -------------------
Data = new Date();
if (dynamicValue === 'connected') { if (dynamicValue === 'connected') {
if ( if (
Boolean(inputValue.toString().length) && Boolean(inputValue.toString().length) &&
call_history.slice(-1)[0] != inputValue call_history.slice(-1)[0] != inputValue
) { ) {
let newCallsStringify = JSON.stringify([...call_history, inputValue]); let newCallsStringify = JSON.stringify([
...call_history,
{
value: inputValue,
time: `${Data.getHours()}:${Data.getMinutes()} | ${Data.getDate()}, ${Data.getMonth()}, ${Data.getFullYear()}`,
},
]);
localStorage.setItem('callhistory', newCallsStringify); localStorage.setItem('callhistory', newCallsStringify);
} }
boxDialer.initialized(inputValue); boxDialer.initialized(inputValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment