Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
26ebe526
Commit
26ebe526
authored
Sep 21, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
418e4f89
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
29 deletions
+23
-29
package.json
package.json
+1
-1
index.jsx
src/root/index.jsx
+22
-28
No files found.
package.json
View file @
26ebe526
{
"name"
:
"boxdialer"
,
"version"
:
"
1.9.9
"
,
"version"
:
"
2.0.0
"
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
...
...
src/root/index.jsx
View file @
26ebe526
...
...
@@ -9,8 +9,8 @@ import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
import
SecondNotifSip
from
'
../components/SecondNotifSip
'
;
const
Root
=
({
data
,
onSetDnd
})
=>
{
const
[
stateData
,
setStateData
]
=
useState
({})
;
let
localValue
=
localStorage
.
getItem
(
'
activeValue
'
)
||
false
;
const
[
dataSecond
,
setDataSecond
]
=
useState
([]);
if
(
!
data
)
{
data
=
{
iscloud
:
true
,
...
...
@@ -31,13 +31,6 @@ const Root = ({ data, onSetDnd }) => {
onSetDnd
=
window
.
alovoice_onsetdnd
;
}
useEffect
(()
=>
{
if
(
data
||
window
.
alovoice_wsphone
)
{
setStateData
(
data
);
}
});
console
.
log
(
'
stateData:
'
,
stateData
,
data
);
const
[
phoneModal
,
setPhoneModal
]
=
useState
(
false
);
const
[
dynamicValue
,
setDynamicValue
]
=
useState
(
'
pending
'
);
const
[
modalState
,
setModalState
]
=
useState
(
false
);
...
...
@@ -54,25 +47,25 @@ const Root = ({ data, onSetDnd }) => {
},
[
secondLine
]);
useEffect
(()
=>
{
if
(
stateData
&&
stateD
ata
?.
number
)
{
if
(
data
&&
d
ata
?.
number
)
{
boxDialer
.
setSipStateChangeCallback
(
setDynamicValue
,
'
dynamicValue
'
);
boxDialer
.
setSipStateChangeCallback
(
setModalState
,
'
modalState
'
);
boxDialer
.
setSipStateChangeCallback
(
setPhoneModal
,
'
phoneModal
'
);
boxDialer
.
setSipStateChangeCallback
(
setSecondLine
,
'
secondLine
'
);
boxDialer
.
sipRegister
(
stateD
ata
);
boxDialer
.
sipRegister
(
d
ata
);
}
set
StateData
(
stateD
ata
);
set
DataSecond
(
d
ata
);
},
[]);
const
hangupButton
=
()
=>
{
boxDialer
.
hangupButtonClick
();
};
window
.
setWSData
=
(
result
)
=>
{
set
StateData
(
result
);
set
DataSecond
(
result
);
};
const
reasonSelect
=
async
(
e
)
=>
{
let
result
=
await
onSetDnd
(
e
);
set
StateData
(
result
);
set
DataSecond
(
result
);
// data = result;
};
const
selectWidjetType
=
(
type
)
=>
{
...
...
@@ -81,11 +74,11 @@ const Root = ({ data, onSetDnd }) => {
return
(
<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
stateD
ata
?.
number
}
reason=
{
stateData
?.
reason
}
phoneNumber=
{
d
ata
?.
number
}
reason=
{
dataSecond
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
stateD
ata
.
lefttime
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
leftTime=
{
dataSecond
.
lefttime
||
d
ata
.
lefttime
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
...
...
@@ -95,11 +88,11 @@ const Root = ({ data, onSetDnd }) => {
return
(
<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
stateD
ata
?.
number
}
reason=
{
stateData
?.
reason
}
phoneNumber=
{
d
ata
?.
number
}
reason=
{
dataSecond
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
stateD
ata
.
lefttime
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
leftTime=
{
d
ata
.
lefttime
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
...
...
@@ -108,21 +101,22 @@ const Root = ({ data, onSetDnd }) => {
}
};
if
(
!
stateData
||
!
stateData
?.
number
||
!
stateData
?.
position
)
return
;
if
(
!
data
||
!
data
?.
number
||
!
data
?.
position
)
return
;
console
.
log
(
modalState
,
'
modalState
'
);
return
(
<>
{
selectWidjetType
(
stateD
ata
.
variant
)
}
{
selectWidjetType
(
d
ata
.
variant
)
}
<
ModalPhoneNumpad
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
reasons=
{
stateD
ata
?.
reasons
}
reason=
{
stateData
?.
reason
}
reasons=
{
d
ata
?.
reasons
}
reason=
{
dataSecond
?.
reason
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
reasonSelect
}
variant=
{
stateD
ata
.
variant
||
'
defaultWidjet
'
}
position=
{
stateD
ata
.
position
||
'
bottomLeft
'
}
variant=
{
d
ata
.
variant
||
'
defaultWidjet
'
}
position=
{
d
ata
.
position
||
'
bottomLeft
'
}
/>
<
Modal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment