Commit ce9b4f1b authored by Muhammadali's avatar Muhammadali

update-

parent d5605256
{
"name": "boxdialer",
"version": "2.9.3",
"version": "2.9.4",
"description": "",
"main": "src/boxDialer.js",
"scripts": {
......
......@@ -59,11 +59,11 @@ const CallHistoryInputDropdown = ({
{call_history.reverse().map((value, index) => (
<ModalDropDown.Item
key={index}
onClick={() => selectFuncInset(value)}
onClick={() => selectFuncInset(value.value)}
hoverBool={
call_history.length - numberSelectHistory === index
}>
{value}
{value.value}
</ModalDropDown.Item>
))}
</ModalDropDown.Inset>
......
......@@ -29,7 +29,13 @@ const ModalPhoneNumpad = ({
let currentCalls = localStorage.getItem('callhistory')
? JSON.parse(localStorage.getItem('callhistory'))
: false;
if (currentCalls) setCall_history(currentCalls);
if (currentCalls) {
// currentCalls.forEach((element) => {
// element.value ? true : false;
// });
setCall_history(currentCalls);
}
}, [localStorage.getItem('callhistory'), inputValue]);
useEffect(() => {
......@@ -170,18 +176,24 @@ const ModalPhoneNumpad = ({
document.removeEventListener('keyup', handleKeyUp);
};
}, [handleKeyUp]);
// `${Data.getHours()}:${Data.getMinutes()} ${Data.getDate()}.${Data.getMonth()+1}.${Data.getFullYear()}`
const callButton = () => {
// inset if ----------
// -------------------
Data = new Date();
if (dynamicValue === 'connected') {
if (
Boolean(inputValue.toString().length) &&
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);
}
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